begin (possible) module rewrite

This commit is contained in:
xunuwu 2024-08-27 00:23:34 +02:00
parent 675d0453ad
commit 7cdfb454eb
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
6 changed files with 68 additions and 3 deletions

View file

@ -74,9 +74,9 @@ in {
#"services/ollama.nix" #"services/ollama.nix"
"desktop/x11/nosleep.nix" "desktop/x11/nosleep.nix"
"programs/gamemode.nix" # "programs/gamemode.nix" # TEMP: TODO
"programs/gamescope.nix" # "programs/gamescope.nix" # TEMP: TODO
"programs/steam.nix" # "programs/steam.nix" # TEMP: TODO
"programs/RE" "programs/RE"
]) ])

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./hardware.nix ./hardware.nix
./hibernate-boot.nix ./hibernate-boot.nix
./testing.nix
]; ];
networking.hostName = "nixdesk"; networking.hostName = "nixdesk";

11
hosts/nixdesk/testing.nix Normal file
View file

@ -0,0 +1,11 @@
{self, ...}: {
imports = [
self.nixosModules.xun
];
xun.gaming = {
enable = true;
steam.enable = true;
gamescope.enable = true;
gamemode.enable = true;
};
}

View file

@ -1,5 +1,6 @@
{ {
flake.nixosModules = { flake.nixosModules = {
#name = import ./name; #name = import ./name;
xun = import ./xun;
}; };
} }

5
modules/xun/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./gaming
];
}

View file

@ -0,0 +1,47 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.xun.gaming;
in {
options.xun.gaming = {
enable = lib.mkEnableOption "gaming";
steam.enable = lib.mkEnableOption "steam";
gamemode.enable = lib.mkEnableOption "gamemode";
gamescope.enable = lib.mkEnableOption "gamescope";
};
config = lib.mkIf cfg.enable ({
programs.gamescope = lib.mkIf cfg.gamescope.enable {
enable = true;
capSysNice = false; # doesnt work with steam & heroic
};
programs.gamemode.enable = cfg.gamemode.enable;
}
// lib.mkIf cfg.steam.enable {
# TODO: protontricks & steamtinkerlaunch
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
## Fixes gamescope (NOTE: no clue what this means)
extraPackages = with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
});
}