Add wine support
This commit is contained in:
parent
533f1494a5
commit
ab9bae3a10
|
@ -87,6 +87,7 @@
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
my.development.embedded-tools.enable = true;
|
my.development.embedded-tools.enable = true;
|
||||||
|
my.games.wine.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,14 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
gpu = config.my.hardware.gpu;
|
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
|
in
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
|
@ -32,10 +39,14 @@ with lib;
|
||||||
# Small hack as this option path changes between 24.05 and unstable
|
# Small hack as this option path changes between 24.05 and unstable
|
||||||
hardware.${hwAccelerationOptionPath} = {
|
hardware.${hwAccelerationOptionPath} = {
|
||||||
enable = gpu != null;
|
enable = gpu != null;
|
||||||
|
|
||||||
|
"${enable32BitOptionName}" = anyWineUser;
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
(mkIf (gpu == "intel") intel-media-driver)
|
(mkIf (gpu == "intel") intel-media-driver)
|
||||||
(mkIf (gpu == "intel") intel-compute-runtime)
|
(mkIf (gpu == "intel") intel-compute-runtime)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ in
|
||||||
./communication.nix
|
./communication.nix
|
||||||
./mail.nix
|
./mail.nix
|
||||||
./helix.nix
|
./helix.nix
|
||||||
|
./games.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -302,7 +302,7 @@ in
|
||||||
default_border pixel
|
default_border pixel
|
||||||
'';
|
'';
|
||||||
|
|
||||||
xwayland = false;
|
xwayland = true;
|
||||||
|
|
||||||
extraSessionCommands = ''
|
extraSessionCommands = ''
|
||||||
${wlrRendererLine}
|
${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