nixpkgs/pkgs/build-support/substitute/generic-substituter.nix
Eelco Dolstra 05c884b471 * Utility: the generic substituter. It substitutes all occurences of
`@var@' in the file `src', writing the result to $out, where `var'
  is any environment variable starting with a lowercase character.
  Example:

    genericSubstituter {
      src = ./file;
      foo = "bla";
      shell = bash + "/bin/sh";
    };

  will replace `@foo@' with `bla' and `@shell@' with
  `/nix/store/...-bash-.../bin/sh'.

svn path=/nixpkgs/trunk/; revision=6928
2006-11-02 22:44:32 +00:00

11 lines
220 B
Nix

{stdenv}:
args:
stdenv.mkDerivation ({
name = if args ? name then args.name else baseNameOf (toString args.src);
builder = ./generic-substituter.sh;
substitute = ./substitute.sh;
inherit (args) src;
} // args)