about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-02-25 17:05:21 +0100
committerene <ene@sils.li>2023-02-25 17:05:21 +0100
commit6ec73592f730ce16734fb4e9c502c2781dfa2e2d (patch)
treecf9b44db036c4c366ca620fc0ecf40c591941795 /lib
parentFix(scripts): Use ll unwrapped (diff)
downloadnixos-config-6ec73592f730ce16734fb4e9c502c2781dfa2e2d.tar.gz
nixos-config-6ec73592f730ce16734fb4e9c502c2781dfa2e2d.zip
Fix(packages): Use a custom function for packaging ll
Diffstat (limited to 'lib')
-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}"
+    '';
 }