tvl-depot/utils/default.nix
William Carroll aa9b81fe21 Move wrapNonNixProgram to utils module
Define the wrapNonNixProgram in my Nix utils module.
2020-03-13 23:03:57 +00:00

14 lines
429 B
Nix

{ pkgs, ... }:
# Using this as a library to define some common utility functions that I often
# reach for.
{
# A unary function that returns its argument.
identity = x: x;
# Create a derivation that creates an executable shell script named `as` that
# calls the program located at `path`, forwarding all of the arguments.
wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
exec ${path} "$@"
'';
}