about summary refs log tree commit diff
path: root/users/Profpatsch/ytextr/create-symlink-farm.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2022-01-09T11·30+0100
committerProfpatsch <mail@profpatsch.de>2022-01-09T12·52+0000
commit71fe30a87c2dd2c7f93fd34f3abd596755f0d016 (patch)
treef20ae2dce439274c1715d1e5861aa8a55e40a080 /users/Profpatsch/ytextr/create-symlink-farm.nix
parentebd5c3ad15a693c3437bdc083c0532b1959ee75a (diff)
feat(users/Profpatsch): add ytextr, a sandboxed yt-dlp wrapper r/3580
Change-Id: Id0992e5c1f52ac2c95444721c7565a66ef484e2b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4836
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
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 000000000000..583a3a90f5c5
--- /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;
+  }