bscpkgs/garlic/stages/experiment.nix

34 lines
493 B
Nix
Raw Normal View History

2020-10-09 01:00:55 +08:00
{
stdenv
2020-10-10 02:28:00 +08:00
, garlicTools
2020-10-09 01:00:55 +08:00
}:
2020-10-09 21:55:37 +08:00
{
2020-10-09 22:13:16 +08:00
units
}:
2020-10-09 01:00:55 +08:00
with stdenv.lib;
2020-10-10 02:28:00 +08:00
with garlicTools;
2020-10-09 01:00:55 +08:00
let
unitsString = builtins.concatStringsSep "\n"
(map (x: "${stageProgram x}") units);
in
stdenv.mkDerivation {
name = "experiment";
phases = [ "installPhase" ];
preferLocalBuild = true;
dontPatchShebangs = true;
inherit units;
installPhase = ''
cat > $out << EOF
#!/bin/sh
# This is an experiment formed by the following units:
${unitsString}
EOF
chmod +x $out
'';
}