summary refs log tree commit diff stats
path: root/bin
diff options
context:
space:
mode:
authorAlan Pearce2024-05-22 18:14:59 +0200
committerAlan Pearce2024-05-22 18:14:59 +0200
commit34e0a182560bb86e85f3ee45cd9b4296576922de (patch)
tree03583a8c27e0608c72651eccafecfea6c5cb3a95 /bin
parent0b55faeb8f21bd38c10439d5fedbbee8bbf7d8e6 (diff)
downloadnixfiles-34e0a182560bb86e85f3ee45cd9b4296576922de.tar.lz
nixfiles-34e0a182560bb86e85f3ee45cd9b4296576922de.tar.zst
nixfiles-34e0a182560bb86e85f3ee45cd9b4296576922de.zip
bin: remove ~/.config/nixpkgs if it's a broken symlink
Diffstat (limited to 'bin')
-rwxr-xr-xbin/home-manager4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/home-manager b/bin/home-manager
index 903e2cab..73d06c7f 100755
--- a/bin/home-manager
+++ b/bin/home-manager
@@ -19,6 +19,10 @@ end
 
 for i in 1
     if test ! -d $user_nixpkgs
+        if test ! -e $user_nixpkgs && test -L $user_nixpkgs
+            echo "~/.config/nixpkgs is a broken symlink, deleting it"
+            rm $channel_root
+        end
         echo "user nixpkgs folder $user_nixpkgs does not exist, creating it"
         mkdir -p $user_nixpkgs
     end