summary refs log tree commit diff stats
path: root/bin/home-manager
diff options
context:
space:
mode:
authorAlan Pearce2024-05-12 12:44:42 +0200
committerAlan Pearce2024-05-18 12:17:12 +0200
commitcb6c1b4d42c5170ee0d4ac61a75c674777c86b53 (patch)
treea287e6ad0daf4f41e0c2cc9146f34ac262af159e /bin/home-manager
parente204add2f6900d93a1d3ba6536f371c619eae614 (diff)
downloadnixfiles-cb6c1b4d42c5170ee0d4ac61a75c674777c86b53.tar.lz
nixfiles-cb6c1b4d42c5170ee0d4ac61a75c674777c86b53.tar.zst
nixfiles-cb6c1b4d42c5170ee0d4ac61a75c674777c86b53.zip
use XDG directories in script
Diffstat (limited to 'bin/home-manager')
-rwxr-xr-xbin/home-manager4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/home-manager b/bin/home-manager
index 672c3403..70ef9064 100755
--- a/bin/home-manager
+++ b/bin/home-manager
@@ -5,7 +5,9 @@ if not set --query HOME
     exit 1
 end
 
-set --function channel_root $HOME/.nix-defexpr/channels
+set --query XDG_STATE_HOME || set --function XDG_STATE_HOME $HOME/.local/state
+set --function nix_state_home $XDG_STATE_HOME/nix
+set --function channel_root $nix_state_home/channels
 set --function user_nixpkgs $HOME/.config/nixpkgs
 set --function nixfiles (path resolve (status dirname)/..)