about summary refs log tree commit diff
path: root/users/Profpatsch/nix-home
diff options
context:
space:
mode:
Diffstat (limited to 'users/Profpatsch/nix-home')
-rw-r--r--users/Profpatsch/nix-home/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/users/Profpatsch/nix-home/default.nix b/users/Profpatsch/nix-home/default.nix
index 2b44868f5a19..1369eb5314cc 100644
--- a/users/Profpatsch/nix-home/default.nix
+++ b/users/Profpatsch/nix-home/default.nix
@@ -5,6 +5,7 @@ let
       // depot.nix.getBins pkgs.coreutils [ "mkdir" "ln" "printenv" "rm" ]
       // depot.nix.getBins pkgs.xe [ "xe" ]
       // depot.nix.getBins pkgs.lr [ "lr" ]
+      // depot.nix.getBins pkgs.nix [ "nix-store" ]
       ;
 
   # run stow to populate the target directory with the given stow package, read from stowDir.
@@ -30,6 +31,14 @@ let
       ]
       bins.xe "-0" bins.rm
     ]
+    # create an indirect gc root so our config is not cleaned under our asses by a garbage collect
+    "if" [
+      bins.nix-store
+        "--realise"
+        "--indirect"
+        "--add-root" "${stowDirOriginPath}/.nix-stowdir-gc-root"
+        stowDir
+    ]
     # populate with new stow targets
     "if" [
       "elglob" "-w0" "stowPackages" "${stowDir}/*"
@@ -85,7 +94,7 @@ lib.pipe {} [
   (d: runStow {
     stowDir = d;
     stowPackage = "hello";
-    targetDir = "/home/philip/tmp";
+    targetDir = "/home/philip/tmp/stowed";
     stowDirOriginPath = "/home/philip/tmp/stowOrigin";
   })
 ]