about summary refs log blame commit diff
path: root/utils/default.nix
blob: df9673daec70e69c1e73e0480616b2bd65a797b7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                               
{ 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} "$@"
  '';
}