about summary refs log tree commit diff
path: root/users/Profpatsch/ytextr/create-symlink-farm.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/Profpatsch/ytextr/create-symlink-farm.nix')
-rw-r--r--users/Profpatsch/ytextr/create-symlink-farm.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/users/Profpatsch/ytextr/create-symlink-farm.nix b/users/Profpatsch/ytextr/create-symlink-farm.nix
new file mode 100644
index 0000000000..583a3a90f5
--- /dev/null
+++ b/users/Profpatsch/ytextr/create-symlink-farm.nix
@@ -0,0 +1,18 @@
+{
+  # list of package attribute names to get at run time
+  packageNamesAtRuntimeJsonPath,
+}:
+let
+  pkgs = import <nixpkgs> {};
+
+  getPkg = pkgName: pkgs.${pkgName};
+
+  packageNamesAtRuntime = builtins.fromJSON (builtins.readFile packageNamesAtRuntimeJsonPath);
+
+  runtime = map getPkg packageNamesAtRuntime;
+
+in
+  pkgs.symlinkJoin {
+    name = "symlink-farm";
+    paths = runtime;
+  }