DynamicRunCommand: don't run if the build failed

This commit is contained in:
Graham Christensen
2021-12-14 22:10:02 -05:00
parent 1a30a0c2f1
commit 216d8bee35
3 changed files with 30 additions and 1 deletions

View File

@ -127,4 +127,22 @@ rec {
];
};
runCommandHook.failed = mkDerivation {
name = "failed";
builder = "/bin/sh";
outputs = [ "out" ];
args = [
(
builtins.toFile "builder.sh" ''
#! /bin/sh
touch $out
chmod +x $out
exit 1
''
)
];
};
}