refactor(home): share XDG base configuration

This commit is contained in:
Ryan Yin
2026-08-30 12:45:24 +08:00
parent 16e48e5740
commit 2cd3a1cee4
5 changed files with 48 additions and 17 deletions
+10
View File
@@ -0,0 +1,10 @@
{ config, ... }:
{
xdg = {
enable = true;
cacheHome = "${config.home.homeDirectory}/.cache";
configHome = "${config.home.homeDirectory}/.config";
dataHome = "${config.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state";
};
}
-3
View File
@@ -17,7 +17,4 @@
../base/gui
../base/home.nix
];
# enable management of XDG base directories on macOS.
xdg.enable = true;
}
+5 -14
View File
@@ -16,21 +16,12 @@
xdg-user-dirs
];
xdg = {
xdg.userDirs = {
enable = true;
cacheHome = "${config.home.homeDirectory}/.cache";
configHome = "${config.home.homeDirectory}/.config";
dataHome = "${config.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state";
userDirs = {
enable = true;
setSessionVariables = true;
createDirectories = true;
extraConfig = {
SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots";
};
setSessionVariables = true;
createDirectories = true;
extraConfig = {
SCREENSHOTS = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
}