aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/failing.nix
blob: d25e2d6b62b665de0969b1d70b17309ef844c450 (plain)
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
{ busybox }:
with import ./config.nix;
let

  mkDerivation = args:
    derivation ({
      inherit system;
      builder = busybox;
      args = ["sh" "-e" args.builder or (builtins.toFile "builder-${args.name}.sh" ''
        if [ -e "$NIX_ATTRS_SH_FILE" ]; then source $NIX_ATTRS_SH_FILE; fi;
        eval "$buildCommand"
      '')];
    } // removeAttrs args ["builder" "meta"])
    // { meta = args.meta or {}; };
in
{

  failing = mkDerivation {
    name = "failing";
    buildCommand = ''
      echo foo > bar
      exit 1
    '';
  };
}