separate gaming module
This commit is contained in:
parent
77e4b275c1
commit
08891bd65c
3 changed files with 90 additions and 81 deletions
59
home-manager/modules/gaming.nix
Normal file
59
home-manager/modules/gaming.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.gaming;
|
||||
in
|
||||
{
|
||||
options.gaming = {
|
||||
enable = mkEnableOption "Enable gaming stuff";
|
||||
|
||||
newWine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If you want to include wine-staging as new-wine";
|
||||
};
|
||||
|
||||
flatSteam = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If you use the flatpak Steam instead of NixOS";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages =
|
||||
let
|
||||
steam = pkgs.steam.override { withJava = true; };
|
||||
|
||||
steam-run = steam.run;
|
||||
|
||||
newwine = (pkgs.wineFull.override { wineBuild = "wineWow"; wineRelease = "staging"; });
|
||||
newwinetricks = pkgs.winetricks.override { wine = newwine; };
|
||||
|
||||
oldwine = pkgs.wineWowPackages.full;
|
||||
oldwinetricks = pkgs.winetricks.override { wine = oldwine; };
|
||||
in
|
||||
with pkgs; [
|
||||
xlibs.xf86inputjoystick
|
||||
oldwine
|
||||
oldwinetricks
|
||||
] ++ lib.optionals (!cfg.flatSteam) [
|
||||
steam
|
||||
steam-run
|
||||
(writeScriptBin "steam-run-native" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
${(steam.override { nativeOnly = true; }).run}/bin/steam-run $@
|
||||
'')
|
||||
] ++ lib.optionals cfg.newWine [
|
||||
(
|
||||
pkgs.runCommand "new-wine-stuff"
|
||||
{ } ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${newwine}/bin/wine $out/bin/new-wine
|
||||
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
|
||||
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
|
||||
''
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue