{ pkgs, lib, config, ... }:
let
    settings = import ./../settings.nix;
in
{
    config = lib.mkMerge [
        # optionally enable native wine for wayland
        (lib.mkIf settings.virtualisation.wine.wayland {
            environment.systemPackages = (with pkgs; [
                # native wayland support (unstable)
                wineWowPackages.waylandFull
            ]);
        })

        # if wayland is off, use package for Xorg
        (lib.mkIf (!settings.virtualisation.wine.wayland) {
            environment.systemPackages = (with pkgs; [
                # support both 32- and 64-bit applications
                wineWowPackages.stagingFull
            ]);
        })

        # winetricks
        (lib.mkIf settings.virtualisation.wine.winetricks {
            environment.systemPackages = (with pkgs; [
                # winetricks (works for all versions of wine)
                winetricks
            ]);
        })
    ];
}
