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.nix19
1 files changed, 19 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 000000000000..7b3a45b91681
--- /dev/null
+++ b/users/Profpatsch/ytextr/create-symlink-farm.nix
@@ -0,0 +1,19 @@
+{
+  # 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;
+}