summary refs log tree commit diff stats
path: root/bin/home-manager
diff options
context:
space:
mode:
Diffstat (limited to 'bin/home-manager')
-rwxr-xr-xbin/home-manager7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/home-manager b/bin/home-manager
index fa4e1df8..8c83cf27 100755
--- a/bin/home-manager
+++ b/bin/home-manager
@@ -7,6 +7,7 @@ end
 
 set --function channel_root $HOME/.nix-defexpr/channels
 set --function user_nixpkgs $HOME/.nixpkgs
+set --function nixfiles (path resolve (status dirname)/..)
 
 if set --query XDG_CONFIG_HOME
     set --function hm_config_dir $XDG_CONFIG_HOME/home-manager
@@ -68,14 +69,14 @@ end
 set --function current_script_name (status basename)
 switch $current_script_name
     case darwin-rebuild
-        set --local darwin_config_source (path resolve (status dirname)/../system/$hostname.nix)
+        set --local darwin_config_source $nixfiles/system/$hostname.nix
         set --local darwin_config_target $user_nixpkgs/darwin-configuration.nix
         if test ! -e $darwin_config_target
             ln -s $darwin_config_source $darwin_config_target
         end
         set --append argv -I darwin-config=$darwin_config_source
     case nixos-rebuild
-        set --local nixos_config_source (path resolve (status dirname)/system/$hostname.nix)
+        set --local nixos_config_source $nixfiles/system/$hostname.nix
         set --local nixos_config_target $user_nixpkgs/configuration.nix
         if test ! -e $nixos_config_target
             ln -s $nixos_config_source $nixos_config_target
@@ -85,7 +86,7 @@ switch $current_script_name
         end
         set --append argv -I nixos-config=$nixos_config_source
     case home-manager
-        set --local hm_config_source (path resolve (status dirname)/../user/$hostname.nix)
+        set --local hm_config_source $nixfiles/user/$hostname.nix
         set --local hm_config_target $hm_config_dir/home.nix
         if test ! -e $hm_config_target
             ln -s $hm_config_source $hm_config_target