Add wine support
This commit is contained in:
parent
533f1494a5
commit
ab9bae3a10
|
@ -87,6 +87,7 @@
|
|||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
my.development.embedded-tools.enable = true;
|
||||
my.games.wine.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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)
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ in
|
|||
./communication.nix
|
||||
./mail.nix
|
||||
./helix.nix
|
||||
./games.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
|
|
|
@ -302,7 +302,7 @@ in
|
|||
default_border pixel
|
||||
'';
|
||||
|
||||
xwayland = false;
|
||||
xwayland = true;
|
||||
|
||||
extraSessionCommands = ''
|
||||
${wlrRendererLine}
|
||||
|
|
15
modules/workstation/home-manager/games.nix
Normal file
15
modules/workstation/home-manager/games.nix
Normal file
|
@ -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 ]; };
|
||||
}
|
Loading…
Reference in a new issue