summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-04 12:57:18 +0200
committerAlan Pearce2024-05-18 12:17:12 +0200
commit0f06c7b1454d849cb365f2700c93ab95d52fbdf6 (patch)
treebb34b03c7eb002db689f19f037c813e0945453af
parent782e0000196146183ee4a7e91e60424c24652d2f (diff)
downloadnixfiles-0f06c7b1454d849cb365f2700c93ab95d52fbdf6.tar.lz
nixfiles-0f06c7b1454d849cb365f2700c93ab95d52fbdf6.tar.zst
nixfiles-0f06c7b1454d849cb365f2700c93ab95d52fbdf6.zip
fix overlays
-rwxr-xr-xbin/home-manager32
-rw-r--r--overlays/default.nix1
2 files changed, 20 insertions, 13 deletions
diff --git a/bin/home-manager b/bin/home-manager
index 8c83cf27..a6e89ce6 100755
--- a/bin/home-manager
+++ b/bin/home-manager
@@ -6,7 +6,7 @@ if not set --query HOME
 end
 
 set --function channel_root $HOME/.nix-defexpr/channels
-set --function user_nixpkgs $HOME/.nixpkgs
+set --function user_nixpkgs $HOME/.config/nixpkgs
 set --function nixfiles (path resolve (status dirname)/..)
 
 if set --query XDG_CONFIG_HOME
@@ -96,6 +96,19 @@ end
 
 set --function old_channels (path basename $channel_root/*)
 
+function update_link --argument-names new_src target
+    set --function current_src (path resolve $target)
+    if test -e $current_src
+        if test $current_src = $new_src
+            # no need to re-link it
+            return
+        else
+            unlink $target
+        end
+    end
+    ln -s $new_src $target
+end
+
 for np in $NIX_PATH
     echo $np | read --function --delimiter "=" channel new_src_rel
     set --local new_src (path resolve $new_src_rel)
@@ -103,20 +116,15 @@ for np in $NIX_PATH
     if test $channel = darwin-config
         continue
     end
+    if test $channel = nixpkgs-overlays
+        update_link $new_src $user_nixpkgs/overlays
+        continue
+    end
     if set --local i (contains --index $channel $old_channels)
         set --erase old_channels[$i]
     end
-    set --local target $channel_root/$channel
-    set --local src (path resolve $target)
-    if test -e $src
-        if test $src = $new_src
-            # no need to re-link it
-            continue
-        else
-            unlink $target
-        end
-    end
-    ln -s $new_src $target
+
+    update_link $new_src $channel_root/$channel
 end
 
 for old in $channel_root/$old_channels
diff --git a/overlays/default.nix b/overlays/default.nix
deleted file mode 100644
index ddb4f237..00000000
--- a/overlays/default.nix
+++ /dev/null
@@ -1 +0,0 @@
-self: super: { }