summary refs log tree commit diff
path: root/pkgs/stdenv/generic/default.nix
blob: d7b953ffb056263a2e0eaf2765e6e031f635c240 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, name, preHook ? null, postHook ? null, initialPath, gcc, bash
, param1 ? "", param2 ? "", param3 ? "", param4 ? "", param5 ? ""
}:

let {

  body =

    stdenv.mkDerivation {
      inherit name;

      builder = ./builder.sh;

      setup = ./setup.sh;

      inherit preHook postHook initialPath gcc;

      # TODO: make this more elegant.
      inherit param1 param2 param3 param4 param5;
    }

    # Add a utility function to produce derivations that use this
    # stdenv and its the bash shell.
    // {
      mkDerivation = attrs: derivation (attrs // {
        builder = bash;
        args = ["-e" (if attrs ? builder then attrs.builder else ./default-builder.sh)];
        stdenv = body;
        system = body.system;
      });
    };

}