diff options
author | Soispha <soispha@vhack.eu> | 2023-04-29 17:31:00 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-05-09 19:32:58 +0200 |
commit | fb206f9be18b4936ef716935c2343531acaf92c2 (patch) | |
tree | 88a86e5ae9f27a050d22397cc2d991a8b9e9b70b /lib/default.nix | |
parent | Docs(todo): Update (diff) | |
download | nixos-config-fb206f9be18b4936ef716935c2343531acaf92c2.tar.gz nixos-config-fb206f9be18b4936ef716935c2343531acaf92c2.zip |
Refactor(treewide): Use separate shell library
Diffstat (limited to 'lib/default.nix')
-rw-r--r-- | lib/default.nix | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 2704944f..00000000 --- a/lib/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - pkgs, - shell-library, - ... -}: let - shellLibraryDeps = - builtins.attrValues {inherit (pkgs) mktemp dash;}; -in { - makeShellScriptWithLibrary = { - 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}" --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, - ... - }: - 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}" - ''; -} |