mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-26 16:35:36 +00:00
17 lines
452 B
Nix
17 lines
452 B
Nix
_final: prev: {
|
|
extraLib = prev.lib // {
|
|
|
|
# Quickly package shell scripts with their dependencies
|
|
# From https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6
|
|
mkScript = { name, file, env ? [ ] }:
|
|
prev.pkgs.writeScriptBin name ''
|
|
for i in ${prev.lib.concatStringsSep " " env}; do
|
|
export PATH="$i/bin:$PATH"
|
|
done
|
|
|
|
exec ${prev.pkgs.bash}/bin/bash ${file} $@
|
|
'';
|
|
};
|
|
|
|
}
|