about summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2022-02-28T12·53+0100
committerProfpatsch <mail@profpatsch.de>2022-02-28T14·32+0000
commit72b46e8fe80d9c8c708602387b4d46cce6bb266d (patch)
tree50b7f29e919085114ae36255c9f0a945a3684f94
parentfd519c825f916d838f87c160425109eb98836e51 (diff)
feat(users/Profpatsch/nix-home): add terminal-emulator to ~/bin r/3878
This is an ad-hoc way of adding “well known” executables to my
user directory for now. It’s not pretty, it is what it is.

Change-Id: I93ee1d75b48536692da86485f0ac517aa1935ec4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5335
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
-rw-r--r--users/Profpatsch/nix-home/default.nix86
1 files changed, 59 insertions, 27 deletions
diff --git a/users/Profpatsch/nix-home/default.nix b/users/Profpatsch/nix-home/default.nix
index fee70f3d6d5e..3f0b7c9c39c5 100644
--- a/users/Profpatsch/nix-home/default.nix
+++ b/users/Profpatsch/nix-home/default.nix
@@ -13,6 +13,7 @@ let
   runStow =
     {
       # “stow package” to stow (see manpage)
+      # TODO: allow this function to un-stow multiple packages!
       stowPackage
     , # “target directory” to stow in (see manpage)
       targetDir
@@ -139,33 +140,64 @@ let
       }))
     ];
 
-in
+  scriptsStow =
+    lib.pipe { } [
+      (_: makeStowDir [{
+        stowPackage = "scripts";
+        originalDir = pkgs.linkFarm "scripts-farm"
+          ([
+            {
+              name = "scripts/ytextr";
+              path = depot.users.Profpatsch.ytextr;
+            }
+          ]
+          ++
+          (lib.pipe depot.users.Profpatsch.aliases [
+            readTreeNamespaceDrvs
+            (map ({ name, drv }: {
+              name = "scripts/${name}";
+              path = drv;
+            }))
+          ]));
+      }])
+      (d: runStow {
+        stowDir = d;
+        stowPackage = "scripts";
+        targetDir = "/home/philip";
+        stowDirOriginPath = "/home/philip/.local/share/nix-home/stow-origin";
+      })
+    ];
 
 
-# TODO: temp setup
-lib.pipe { } [
-  (_: makeStowDir [{
-    stowPackage = "scripts";
-    originalDir = pkgs.linkFarm "scripts-farm"
-      ([
-        {
-          name = "scripts/ytextr";
-          path = depot.users.Profpatsch.ytextr;
-        }
-      ]
-      ++
-      (lib.pipe depot.users.Profpatsch.aliases [
-        readTreeNamespaceDrvs
-        (map ({ name, drv }: {
-          name = "scripts/${name}";
-          path = drv;
-        }))
-      ]));
-  }])
-  (d: runStow {
-    stowDir = d;
-    stowPackage = "scripts";
-    targetDir = "/home/philip";
-    stowDirOriginPath = "/home/philip/.local/share/nix-home/stow-origin";
-  })
+
+  terminalEmulatorStow =
+    lib.pipe { } [
+      (_: makeStowDir [{
+        stowPackage = "terminal-emulator";
+        originalDir = pkgs.linkFarm "terminal-emulator-farm"
+          ([
+            {
+              name = "bin/terminal-emulator";
+              path = depot.users.Profpatsch.alacritty;
+            }
+          ]);
+
+      }])
+      (d: runStow {
+        stowDir = d;
+        stowPackage = "terminal-emulator";
+        targetDir = "/home/philip";
+        # TODO: this should only be done once, in a single runStow instead of multiple
+        stowDirOriginPath = "/home/philip/.local/share/nix-home/stow-origin-terminal-emulator";
+      })
+    ];
+
+in
+
+# TODO: run multiple stows with runStow?
+  # TODO: temp setup
+depot.nix.writeExecline "nix-home" { } [
+  "if"
+  [ scriptsStow ]
+  terminalEmulatorStow
 ]