From a137506a1358b9c27e6b1c4e0c17958d8fafba5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 21:50:59 +0100 Subject: [PATCH] Separate option for gaming --- curacao/options.nix | 1 + full/options.nix | 1 + hm/common.nix | 1 + hm/default.nix | 1 + hm/extra.nix | 8 -------- hm/gaming/default.nix | 15 +++++++++++++++ options.nix | 1 + os/default.nix | 3 ++- os/gaming/default.nix | 7 +++++++ 9 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 hm/gaming/default.nix create mode 100644 os/gaming/default.nix diff --git a/curacao/options.nix b/curacao/options.nix index 0fcf285..be760c1 100644 --- a/curacao/options.nix +++ b/curacao/options.nix @@ -6,5 +6,6 @@ docker = true; }; extra = true; + gaming = true; }; } diff --git a/full/options.nix b/full/options.nix index 33b7620..e4b1dda 100644 --- a/full/options.nix +++ b/full/options.nix @@ -10,5 +10,6 @@ python = true; }; extra = true; + gaming = true; }; } diff --git a/hm/common.nix b/hm/common.nix index 7f3f353..f8a026c 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -395,6 +395,7 @@ in curl python3Packages.pip rename + which # shell zsh-completions diff --git a/hm/default.nix b/hm/default.nix index 389d559..13087c4 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -6,6 +6,7 @@ ./desktop.nix ./dev.nix ./extra.nix + ./gaming ./ssh.nix ./style.nix ./vim.nix diff --git a/hm/extra.nix b/hm/extra.nix index 22d2eb7..37423c3 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -51,16 +51,8 @@ transmission-qt # FIXME Below not on aarch64 - # wine wine # TODO wine-gecko wine-mono lib32-libpulse (?) - - # gaming - # steam # FIXME Requires i686-linux or something. IIRC the package says to use the NixOS config and not it directly. - yuzu-mainline - minecraft - # TODO factorio - ]); }; } diff --git a/hm/gaming/default.nix b/hm/gaming/default.nix new file mode 100644 index 0000000..3eaf8c2 --- /dev/null +++ b/hm/gaming/default.nix @@ -0,0 +1,15 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.gaming { + # Using config.nixpkgs. creates an infinite recursion, + # but the above might not be correct in case of cross-compiling? + home.packages = with pkgs; [ + # gaming + yuzu-mainline + minecraft + # TODO factorio + + steam # Common pitfall: https://github.com/NixOS/nixpkgs/issues/86506#issuecomment-623746883 + ]; + }; +} diff --git a/options.nix b/options.nix index 6dc3379..4b763d5 100644 --- a/options.nix +++ b/options.nix @@ -2,6 +2,7 @@ { options.frogeye = { extra = lib.mkEnableOption "Big software"; + gaming = lib.mkEnableOption "Games"; desktop = { xorg = lib.mkEnableOption "Enable X11 support"; nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; diff --git a/os/default.nix b/os/default.nix index c60ff95..f693171 100644 --- a/os/default.nix +++ b/os/default.nix @@ -3,9 +3,10 @@ imports = [ ../options.nix ./battery.nix - ./geoffrey.nix ./common.nix ./desktop.nix + ./gaming + ./geoffrey.nix ./wireless.nix "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" ]; diff --git a/os/gaming/default.nix b/os/gaming/default.nix new file mode 100644 index 0000000..d4284dd --- /dev/null +++ b/os/gaming/default.nix @@ -0,0 +1,7 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.gaming { + programs.steam.enable = true; + hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses + }; +}