diff --git a/machine/thinkrac/hardware.nix b/machine/thinkrac/hardware.nix index 4039dc93..d7482541 100644 --- a/machine/thinkrac/hardware.nix +++ b/machine/thinkrac/hardware.nix @@ -18,6 +18,7 @@ "usb_storage" "sd_mod" ]; + isIntelGPU = true; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; diff --git a/modules/default.nix b/modules/default.nix index 56f92712..47c81ac7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -22,6 +22,7 @@ with lib; options.isGraphical = mkEnableOption "Whether or not this configuration is a graphical install"; options.isInstaller = mkEnableOption "Whether or not this configuration is an installer and has no access to secrets"; options.isNSFW = mkEnableOption "Whether or not this configuration is NSFW"; + options.isIntelGPU = mkEnableOption "Whether or not this configuration uses an Intel GPU"; config = if !inTester then diff --git a/programs/editors/vscode/default.nix b/programs/editors/vscode/default.nix index 44d8fd0c..4e10b328 100644 --- a/programs/editors/vscode/default.nix +++ b/programs/editors/vscode/default.nix @@ -1,4 +1,11 @@ -{ vscode-server, pkgs, ... }: +{ + vscode-server, + config, + systemConfig, + lib, + pkgs, + ... +}: { imports = [ "${vscode-server}/modules/vscode-server/home.nix" @@ -58,4 +65,30 @@ }; }; services.vscode-server.enable = true; + systemd.user.tmpfiles.rules = lib.mkMerge [ + [ + "d /persistent${config.xdg.cacheHome}/Code/Cache - - - - -" + "d /persistent${config.xdg.cacheHome}/Code/CachedData - - - - -" + "d /persistent${config.xdg.cacheHome}/Code/CachedProfilesData - - - - -" + "d /persistent${config.xdg.cacheHome}/Code/Code\x20Cache - - - - -" + "d /persistent${config.xdg.cacheHome}/Code/DawnGraphiteCache - - - - -" + "d /persistent${config.xdg.dataHome}/Code - - - - -" + "L /persistent${config.xdg.dataHome}/Code/Cache - - - - ${config.xdg.cacheHome}/Code/Cache" + "L /persistent${config.xdg.dataHome}/Code/CachedData - - - - ${config.xdg.cacheHome}/Code/CachedData" + "L /persistent${config.xdg.dataHome}/Code/CachedProfilesData - - - - ${config.xdg.cacheHome}/Code/CachedProfilesData" + "L /persistent${config.xdg.dataHome}/Code/Code\x20Cache - - - - ${config.xdg.cacheHome}/Code/Code\x20Cache" + "L /persistent${config.xdg.dataHome}/Code/DawnGraphiteCache - - - - ${config.xdg.cacheHome}/Code/DawnGraphiteCache" + "L ${config.xdg.configHome}/Code - - - - ${config.xdg.dataHome}/Code" + ] + (lib.mkIf (!systemConfig.isIntelGPU) [ + # GPU Cache sometimes breaks for electron apps on intel + "d /persistent${config.xdg.cacheHome}/Code/DawnWebGPUCache - - - - -" + "d /persistent${config.xdg.cacheHome}/Code/GPUCache - - - - -" + "L /persistent${config.xdg.dataHome}/Code/DawnWebGPUCache - - - - ${config.xdg.cacheHome}/Code/DawnWebGPUCache" + "L /persistent${config.xdg.dataHome}/Code/GPUCache - - - - ${config.xdg.cacheHome}/Code/GPUCache" + ]) + ]; + home.persistence.default.directories = [ + ".local/share/Code" + ]; }