Commit a6cdae2f0731

Vincent Demeester <vincent@sbr.pm>
2025-04-23 01:58:58
home: fix nix profile path with xdg nix settings
Also set the same settings for system and user. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent f50a77b
Changed files (2)
home
home/common/shell/zsh.nix
@@ -38,11 +38,10 @@
       # c.f. https://wiki.gnupg.org/AgentForwarding
       # gpgconf --create-socketdir &!
       path+="$HOME/${config.programs.zsh.dotDir}/functions"
-      fpath+="$HOME/.nix-profile/share/zsh/site-functions"
+      fpath+="$HOME/.local/state/nix/profile/share/zsh/site-functions"
       fpath+="$HOME/${config.programs.zsh.dotDir}/functions"
       for func ($HOME/${config.programs.zsh.dotDir}/functions) autoload -U $func/*(x:t)
       autoload -Uz select-word-style; select-word-style bash
-      if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
       #if [ -n "$INSIDE_EMACS" ]; then
       #  chpwd() { print -P "\033AnSiTc %d" }
       #  print -P "\033AnSiTu %n"
@@ -97,9 +96,6 @@
         exec dbus-run-session sway
       fi
     '';
-    profileExtra = ''
-      if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi
-    '';
     sessionVariables = { RPROMPT = ""; };
 
     shellAliases = {
home/default.nix
@@ -26,6 +26,14 @@
     homeDirectory = "/home/${username}";
   };
 
+  nix.settings = {
+    experimental-features = [
+      "nix-command"
+      "flakes"
+    ];
+    use-xdg-base-directories = true;
+  };
+
   nixpkgs = {
     overlays = [