fix xdg base dirs

This commit is contained in:
jacekpoz 2024-10-03 17:40:02 +02:00
parent 92c568883a
commit c68aac2cfc
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -4,8 +4,25 @@
}: let
inherit (config.poz.other.system) username;
hmCfg = config.home-manager.users.${username};
# https://specifications.freedesktop.org/basedir-spec/latest/
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_DIRS = "/etc/xdg";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_DIRS = "/usr/local/share/:/usr/share/";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
in {
environment.sessionVariables = {
inherit
XDG_CACHE_HOME
XDG_CONFIG_DIRS
XDG_CONFIG_HOME
XDG_DATA_DIRS
XDG_DATA_HOME
XDG_STATE_HOME
;
ANDROID_HOME = "${hmCfg.xdg.dataHome}/android";
CARGO_HOME = "${hmCfg.xdg.dataHome}/cargo";
DOTNET_CLI_HOME = "${hmCfg.xdg.dataHome}/dotnet";
@ -22,7 +39,6 @@ in {
RUSTUP_HOME = "${hmCfg.xdg.dataHome}/rustup";
WINEPREFIX = "${hmCfg.xdg.dataHome}/wine";
XAUTHORITY = "\$XDG_RUNTIME_DIR/Xauthority";
XDG_CACHE_HOME = hmCfg.xdg.cacheHome;
};
poz.programs.zsh.extraAliases = {
@ -63,10 +79,10 @@ in {
'';
};
cacheHome = "${hmCfg.home.homeDirectory}/.cache";
configHome = "${hmCfg.home.homeDirectory}/.config";
dataHome = "${hmCfg.home.homeDirectory}/.local/share";
stateHome = "${hmCfg.home.homeDirectory}/.local/state";
cacheHome = XDG_CACHE_HOME;
configHome = XDG_CONFIG_HOME;
dataHome = XDG_DATA_HOME;
stateHome = XDG_STATE_HOME;
mimeApps = {
enable = true;
defaultApplications = let