diff --git a/README.org b/README.org index ac8a3b6..bf2831b 100644 --- a/README.org +++ b/README.org @@ -925,6 +925,12 @@ X11, or X[fn:25] is the generic name for the X Window System Display Server. All services.xserver.displayManager.startx.enable = true; environment = { + variables = { + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_BIN_HOME = "$HOME/.local/bin"; + }; systemPackages = with pkgs; [ pkgs.sqlite pkgs.pfetch @@ -1075,6 +1081,12 @@ in { # Add the offload script to the $PATH. environment.systemPackages = [ myNvidiaOffload ]; + # Configure XDG compliance. + environment.variables = { + __GL_SHADER_DISK_CACHE_PATH = "$XDG_CACHE_HOME/nv"; + CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv"; + }; + # Enable the NVIDIA drivers. # NOTE: You may need to use either of the commands below: services.xserver.videoDrivers = [ "nvidia" ]; diff --git a/modules/nvidia.nix b/modules/nvidia.nix index 9f89ebc..f989bd9 100644 --- a/modules/nvidia.nix +++ b/modules/nvidia.nix @@ -15,6 +15,12 @@ in { # Add the offload script to the $PATH. environment.systemPackages = [ myNvidiaOffload ]; + # Configure XDG compliance. + environment.variables = { + __GL_SHADER_DISK_CACHE_PATH = "$XDG_CACHE_HOME/nv"; + CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv"; + }; + # Enable the NVIDIA drivers. # NOTE: You may need to use either of the commands below: services.xserver.videoDrivers = [ "nvidia" ]; diff --git a/modules/x11.nix b/modules/x11.nix index ac74a47..7985d7b 100644 --- a/modules/x11.nix +++ b/modules/x11.nix @@ -8,6 +8,12 @@ services.xserver.displayManager.startx.enable = true; environment = { + variables = { + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_BIN_HOME = "$HOME/.local/bin"; + }; systemPackages = with pkgs; [ pkgs.sqlite pkgs.pfetch