aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-03-22 17:40:23 +0100
committerene <ene@sils.li>2023-03-22 17:46:25 +0100
commitd4b781e23a458c4b4eec8bda090d89cd82cfe69f (patch)
treee21ed03ede96135332734f2f05f657e6994d652a /lib
parentFix(bootstrap/activate): Normalize nix run call (diff)
downloadnixos-config-d4b781e23a458c4b4eec8bda090d89cd82cfe69f.zip
Fix(hm/wms/river): Fix path in init file
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
index f368121a..2704944f 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -23,6 +23,24 @@ in {
wrapProgram "$out/bin/${name}" --set PATH ${pkgs.lib.makeBinPath shellDependencies}
'';
+ # This dumps the extra things in the default path; TODO fix this
+ makeShellScriptWithLibraryAndKeepPath = {
+ dependencies,
+ name,
+ script,
+ ...
+ }: let
+ shellDependencies = dependencies ++ shellLibraryDeps;
+ in
+ pkgs.runCommandLocal name {
+ nativeBuildInputs = [pkgs.makeWrapper] ++ shellDependencies;
+ } ''
+ install -m755 ${script} -D "$out/bin/${name}"
+ sed -i 's|%SHELL_LIBRARY_PATH|${shell-library}/lib|' "$out/bin/${name}"
+ patchShebangs "$out/bin/${name}"
+ wrapProgram "$out/bin/${name}" --prefix PATH : ${pkgs.lib.makeBinPath shellDependencies}
+ '';
+
makeShellScriptWithLibraryUnwrapped = {
name,
script,