From 554e706717d0666ef103e66dcafa228befc7f1e9 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Thu, 30 Jan 2025 18:39:04 +0100 Subject: [PATCH] feat: add gaming role --- flake.lock | 40 +++++++++---------- flake.nix | 2 +- hosts/marr/default.nix | 16 +++++++- hosts/marr/home.nix | 3 ++ modules/nix/default.nix | 9 ++++- modules/programs/default.nix | 1 - options/system/roles/default.nix | 1 + .../system/roles/gaming.nix | 23 ++++++++--- 8 files changed, 64 insertions(+), 31 deletions(-) rename modules/programs/steam.nix => options/system/roles/gaming.nix (54%) diff --git a/flake.lock b/flake.lock index f204672..d94871e 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1723293904, - "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "lastModified": 1736955230, + "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", "owner": "ryantm", "repo": "agenix", - "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", "type": "github" }, "original": { @@ -52,11 +52,11 @@ ] }, "locked": { - "lastModified": 1733168902, - "narHash": "sha256-8dupm9GfK+BowGdQd7EHK5V61nneLfr9xR6sc5vtDi0=", + "lastModified": 1737038063, + "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", "owner": "nix-community", "repo": "disko", - "rev": "785c1e02c7e465375df971949b8dcbde9ec362e5", + "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", "type": "github" }, "original": { @@ -72,11 +72,11 @@ ] }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "lastModified": 1736143030, + "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "type": "github" }, "original": { @@ -110,11 +110,11 @@ ] }, "locked": { - "lastModified": 1733873195, - "narHash": "sha256-dTosiZ3sZ/NKoLKQ++v8nZdEHya0eTNEsaizNp+MUPM=", + "lastModified": 1737762889, + "narHash": "sha256-5HGG09bh/Yx0JA8wtBMAzt0HMCL1bYZ93x4IqzVExio=", "owner": "nix-community", "repo": "home-manager", - "rev": "f26aa4b76fb7606127032d33ac73d7d507d82758", + "rev": "daf04c5950b676f47a794300657f1d3d14c1a120", "type": "github" }, "original": { @@ -125,11 +125,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1733861262, - "narHash": "sha256-+jjPup/ByS0LEVIrBbt7FnGugJgLeG9oc+ivFASYn2U=", + "lastModified": 1737751639, + "narHash": "sha256-ZEbOJ9iT72iwqXsiEMbEa8wWjyFvRA9Ugx8utmYbpz4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "cf737e2eba82b603f54f71b10cb8fd09d22ce3f5", + "rev": "dfad538f751a5aa5d4436d9781ab27a6128ec9d4", "type": "github" }, "original": { @@ -169,11 +169,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1733759999, - "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", "type": "github" }, "original": { @@ -218,11 +218,11 @@ "rev": "9208515d0f98f26291a023c4b5ca6e546784da74", "revCount": 3, "type": "git", - "url": "https://git.ccnlc.eu/Nydragon/packages.git" + "url": "https://git.ccnlc.eu/nydragon/packages.git" }, "original": { "type": "git", - "url": "https://git.ccnlc.eu/Nydragon/packages.git" + "url": "https://git.ccnlc.eu/nydragon/packages.git" } }, "quickshell": { diff --git a/flake.nix b/flake.nix index ac88030..460630c 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ }; packages = { - url = "git+https://git.ccnlc.eu/Nydragon/packages.git"; + url = "git+https://git.ccnlc.eu/nydragon/packages.git"; inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/hosts/marr/default.nix b/hosts/marr/default.nix index 5cf650a..354d8f4 100644 --- a/hosts/marr/default.nix +++ b/hosts/marr/default.nix @@ -18,7 +18,10 @@ fs.nfsEnable = true; system = { - roles.desktop.enable = true; + roles = { + desktop.enable = true; + gaming.enable = true; + }; outputs = { eDP-1 = { @@ -94,6 +97,11 @@ }; }; + hardware.sane = { + enable = true; + extraBackends = [ pkgs.hplipWithPlugin ]; + }; + services = { displayManager.sddm.enable = true; dbus.enable = true; @@ -153,8 +161,14 @@ virtualisation = { libvirtd.enable = true; + docker = { + enable = true; + rootless.enable = true; + }; }; + programs.virt-manager.enable = true; + programs.nix-ld.enable = true; environment.systemPackages = with pkgs; [ diff --git a/hosts/marr/home.nix b/hosts/marr/home.nix index 61cf0ce..49f430c 100644 --- a/hosts/marr/home.nix +++ b/hosts/marr/home.nix @@ -58,6 +58,9 @@ signal-desktop onlyoffice-desktopeditors picard + simple-scan + insomnia + beekeeper-studio # Proprietary postman diff --git a/modules/nix/default.nix b/modules/nix/default.nix index ba091c8..51c2e2e 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -2,8 +2,13 @@ { imports = [ ./overlays.nix ]; - nixpkgs.config = { - allowUnfree = true; + nixpkgs = { + config = { + allowUnfree = true; + permittedInsecurePackages = [ + "electron-31.7.7" + ]; + }; }; nix = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 38e2693..6cb9eda 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -4,7 +4,6 @@ ./thunderbird.nix ./sway.nix ./lazygit.nix - ./steam.nix ./hyprland.nix ./ssh.nix ./fish.nix diff --git a/options/system/roles/default.nix b/options/system/roles/default.nix index 60a8656..c6bab79 100644 --- a/options/system/roles/default.nix +++ b/options/system/roles/default.nix @@ -2,5 +2,6 @@ imports = [ ./terminal.nix ./desktop.nix + ./gaming.nix ]; } diff --git a/modules/programs/steam.nix b/options/system/roles/gaming.nix similarity index 54% rename from modules/programs/steam.nix rename to options/system/roles/gaming.nix index 08591f9..1085120 100644 --- a/modules/programs/steam.nix +++ b/options/system/roles/gaming.nix @@ -1,25 +1,36 @@ { - pkgs, lib, + pkgs, config, ... }: +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.modules.system.roles.gaming; +in { - config = lib.mkIf config.programs.steam.enable { + options.modules.system.roles.gaming = { + enable = mkEnableOption "gaming features"; + }; + + config = mkIf cfg.enable { programs.gamescope = { enable = true; capSysNice = true; }; - environment = { - systemPackages = [ pkgs.mangohud ]; - }; - programs.steam = { + enable = true; gamescopeSession.enable = true; # Adds a steam entry to the login manager extest.enable = true; localNetworkGameTransfers.openFirewall = true; extraCompatPackages = with pkgs; [ proton-ge-bin ]; }; + + environment.systemPackages = with pkgs; [ + lutris + mangohud + ]; }; }