about summary refs log tree commit diff stats
path: root/lib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 0e2caf1b..35e02d45 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -17,4 +17,17 @@
       patchShebangs "$out/bin/${name}"
       wrapProgram "$out/bin/${name}" --prefix PATH : ${pkgs.lib.makeBinPath dependencies}
     '';
+
+  makeShellScriptWithLibraryUnwrapped = {
+    name,
+    script,
+    ...
+  }:
+    pkgs.runCommandLocal name {
+      nativeBuildInputs = [];
+    } ''
+      install -m755 ${script} -D "$out/bin/${name}"
+      sed -i 's|%SHELL_LIBRARY_PATH|${shell-library}/lib|' "$out/bin/${name}"
+      patchShebangs "$out/bin/${name}"
+    '';
 }