diff options
author | Alan Pearce | 2023-09-01 21:23:53 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-01 21:23:53 +0200 |
commit | 6df90f2470db9ec3b2febf684a08493dcddf2459 (patch) | |
tree | a5c5ca348a7a4a7df2db05822a9955de5d4f736f /user/settings/base.nix | |
parent | e314ff32e87451b9574b4b762986e37b42f0fd24 (diff) | |
download | nixfiles-6df90f2470db9ec3b2febf684a08493dcddf2459.tar.lz nixfiles-6df90f2470db9ec3b2febf684a08493dcddf2459.tar.zst nixfiles-6df90f2470db9ec3b2febf684a08493dcddf2459.zip |
Configure programs to "follow" XDG spec
Diffstat (limited to 'user/settings/base.nix')
-rw-r--r-- | user/settings/base.nix | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/user/settings/base.nix b/user/settings/base.nix index eac06748..a3a67593 100644 --- a/user/settings/base.nix +++ b/user/settings/base.nix @@ -12,10 +12,29 @@ manual = { html.enable = true; }; - home.sessionVariables = { - EMAIL = "alan@alanpearce.eu"; - MANPAGER = "bat -l man -p"; - }; + home.sessionVariables = + let + conf = config.xdg.configHome; + data = config.xdg.dataHome; + cache = config.xdg.cacheHome; + state = config.xdg.stateHome; + in + { + EMAIL = "alan@alanpearce.eu"; + MANPAGER = "bat -l man -p"; + ABDUCO_SOCKET_DIR = "${state}/abduco"; + GNUPGHOME = "${data}/gnupg"; + SOLARGRAPH_CACHE = "${cache}/solargraph"; + ASPELL_CONF = "per-conf ${conf}/aspell/aspell.conf; personal ${conf}/aspell/en.pws; repl ${conf}/aspell/en.prepl"; + ELECTRUMDIR = "${data}/electrum"; + DOCKER_CONFIG = "${conf}/docker"; + npm_config_userconfig = "${conf}/npm/config"; + PASSWORD_STORE_HOME = "${data}/password-store"; + WGETRC = pkgs.writeText "wgetrc" '' + hsts-file = ${cache}/wget-hsts + ''; + SQLITE_HISTORY = "${data}/sqlite_history"; + }; xdg = { enable = true; cacheHome = @@ -24,7 +43,10 @@ else "${config.home.homeDirectory}/.cache"; configHome = "${config.home.homeDirectory}/.config"; dataHome = "${config.home.homeDirectory}/.local/share"; - stateHome = "${config.home.homeDirectory}/.local/state"; + stateHome = + if pkgs.stdenv.isDarwin + then "${config.home.homeDirectory}/Library/Caches/TemporaryItems/State" + else "${config.home.homeDirectory}/.local/state"; }; home.shellAliases = { |