diff --git a/configurations/london/default.nix b/configurations/london/default.nix index 972bf7f..b2bf530 100644 --- a/configurations/london/default.nix +++ b/configurations/london/default.nix @@ -87,6 +87,7 @@ nixpkgs.config.allowUnfree = true; my.development.embedded-tools.enable = true; + my.games.wine.enable = true; }; }; }; diff --git a/modules/common/hardware.nix b/modules/common/hardware.nix index e7f044e..c47156f 100644 --- a/modules/common/hardware.nix +++ b/modules/common/hardware.nix @@ -7,7 +7,14 @@ }: let gpu = config.my.hardware.gpu; - hwAccelerationOptionPath = if (machineProps == "unstable") then "graphics" else "opengl"; + hwAccelerationOptionPath = if (machineProps.nixpkgs == "unstable") then "graphics" else "opengl"; + enable32BitOptionName = + if (machineProps.nixpkgs == "unstable") then "enable32Bit" else "driSupport32Bit"; + anyWineUser = + if machineProps.enableHomeManager then + (builtins.any (user: user.my.games.wine.enable) (builtins.attrValues config.home-manager.users)) + else + false; in with lib; { @@ -32,10 +39,14 @@ with lib; # Small hack as this option path changes between 24.05 and unstable hardware.${hwAccelerationOptionPath} = { enable = gpu != null; + + "${enable32BitOptionName}" = anyWineUser; + extraPackages = with pkgs; [ (mkIf (gpu == "intel") intel-media-driver) (mkIf (gpu == "intel") intel-compute-runtime) ]; }; + }; } diff --git a/modules/workstation/home-manager/default.nix b/modules/workstation/home-manager/default.nix index 8a4be78..c92b3b3 100644 --- a/modules/workstation/home-manager/default.nix +++ b/modules/workstation/home-manager/default.nix @@ -28,6 +28,7 @@ in ./communication.nix ./mail.nix ./helix.nix + ./games.nix ]; config = { diff --git a/modules/workstation/home-manager/desktop/sway/default.nix b/modules/workstation/home-manager/desktop/sway/default.nix index 4be5732..50e6c53 100644 --- a/modules/workstation/home-manager/desktop/sway/default.nix +++ b/modules/workstation/home-manager/desktop/sway/default.nix @@ -302,7 +302,7 @@ in default_border pixel ''; - xwayland = false; + xwayland = true; extraSessionCommands = '' ${wlrRendererLine} diff --git a/modules/workstation/home-manager/games.nix b/modules/workstation/home-manager/games.nix new file mode 100644 index 0000000..0806823 --- /dev/null +++ b/modules/workstation/home-manager/games.nix @@ -0,0 +1,15 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; +{ + options.my.games.wine.enable = mkOption { + type = types.bool; + default = false; + }; + + config = mkIf config.my.games.wine.enable { home.packages = with pkgs; [ wine ]; }; +}