Refactor XDG user directories

This commit is contained in:
Oliver Davies 2025-03-25 23:36:52 +00:00
parent 4ae602d0fa
commit 40c8776e4b
3 changed files with 14 additions and 11 deletions
nix
home/opdavies
modules/home-manager/cli

View file

@ -80,16 +80,19 @@ in
PULUMI_SKIP_UPDATE_CHECK = "true";
W3M_DIR = "${stateHome}/w3m";
WGETRC = "${configHome}/wgetrc";
XDG_CONFIG_HOME = configHome;
XDG_DATA_HOME = dataHome;
XDG_DOCUMENTS_DIR = "$HOME/Documents";
XDG_REPOS_DIR = "$HOME/Code";
XDG_STATE_HOME = config.xdg.stateHome;
};
xdg.configFile = {
"${config.home.sessionVariables.WGETRC}".text = ''
hsts-file = "${cacheHome}/wget-hsts"
'';
xdg = {
configFile = {
"${config.home.sessionVariables.WGETRC}".text = ''
hsts-file = "${cacheHome}/wget-hsts"
'';
};
userDirs = {
extraConfig = {
XDG_REPOS_DIR = "${config.home.homeDirectory}/Code";
};
};
};
}

View file

@ -29,7 +29,7 @@
includes = [
{
condition = "gitdir:${config.home.sessionVariables.XDG_REPOS_DIR}/tfw";
condition = "gitdir:${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/tfw";
contents.user.email = "oliver.davies@tfw.wales";
}
];

View file

@ -10,6 +10,6 @@
s = "secrets";
secrets = ''doppler --project "$(whoami)" run'';
tag = "tag-release";
vss = "LC_ALL=C sort --unique ${config.home.sessionVariables.XDG_REPOS_DIR}/dotfiles/nvim/spell/en.utf-8.add --output ${config.home.sessionVariables.XDG_REPOS_DIR}/dotfiles/nvim/spell/en.utf-8.add";
vss = "LC_ALL=C sort --unique ${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/dotfiles/nvim/spell/en.utf-8.add --output ${config.xdg.userDirs.extraConfig.XDG_REPOS_DIR}/dotfiles/nvim/spell/en.utf-8.add";
wt = "git worktree";
}