summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/settings/base.nix32
-rw-r--r--user/settings/development/javascript.nix2
-rw-r--r--user/settings/satoshipay.nix2
3 files changed, 29 insertions, 7 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 = {
diff --git a/user/settings/development/javascript.nix b/user/settings/development/javascript.nix
index 4e6722f9..d68de810 100644
--- a/user/settings/development/javascript.nix
+++ b/user/settings/development/javascript.nix
@@ -119,7 +119,7 @@ in
     npul = "npm unlink";
   };
 
-  home.file.".npmrc".text = ''
+  xdg.configFile."npm/config".text = ''
     prefix=''${HOME}/.local
     cache=${config.xdg.cacheHome}/npm/
     store-dir=${config.xdg.cacheHome}/pnpm/
diff --git a/user/settings/satoshipay.nix b/user/settings/satoshipay.nix
index 798960bb..558f8791 100644
--- a/user/settings/satoshipay.nix
+++ b/user/settings/satoshipay.nix
@@ -107,7 +107,7 @@ in
       };
     };
 
-  home.file.".npmrc".text = ''
+  xdg.configFile."npm/config".text = ''
     @satoshipay:registry=https://registry.npmjs.org/
   '';
 }