[Desktop] Refactor config in smaller files

This commit is contained in:
Antoine Viallon 2022-11-09 17:28:43 +01:00
parent 16073bf6fb
commit 773c7844bc
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
4 changed files with 84 additions and 21 deletions

View file

@ -6,7 +6,6 @@ let
filterConfig = pkgs.callPackage ./packages/pipewire-noise-filter.cfg.nix {
noiseFilterStrength = cfg.audio.noise-filter.strength;
};
mkTmpDir = dirpath: cleanup: "D ${dirpath} 777 root root ${cleanup}";
in {
options.aviallon.desktop = {
enable = mkOption {
@ -54,8 +53,7 @@ in {
};
imports = [
./desktop/plasma.nix
./desktop/developer.nix
./desktop
];
config = mkIf cfg.enable {
@ -207,24 +205,6 @@ in {
};
programs.steam.enable = !generalCfg.minimal;
hardware.steam-hardware.enable = !generalCfg.minimal;
programs.steam.remotePlay.openFirewall = true;
environment.variables = {
"__GL_SHADER_DISK_CACHE" = "true";
"__GL_SHADER_DISK_CACHE_SIZE" = "${toString (50 * 1000)}";
"__GL_SHADER_DISK_CACHE_SKIP_CLEANUP" = "1"; # Avoid 128mb limit of shader cache
"__GL_SHADER_DISK_CACHE_PATH" = cfg.graphics.shaderCache.path + "/nvidia" ;
"MESA_SHADER_CACHE_MAX_SIZE" = "50G"; # Put large-enough value. Default is only 1G
"MESA_SHADER_CACHE_DIR" = cfg.graphics.shaderCache.path + "/mesa";
"MESA_GLSL_CACHE_DIR" = cfg.graphics.shaderCache.path + "/mesa";
};
systemd.tmpfiles.rules = [
(mkTmpDir (cfg.graphics.shaderCache.path + "/nvidia") cfg.graphics.shaderCache.cleanupInterval)
(mkTmpDir (cfg.graphics.shaderCache.path + "/mesa") cfg.graphics.shaderCache.cleanupInterval)
];
aviallon.programs.allowUnfreeList = [
"spotify"
"spotify-unwrapped"