2020-03-27 22:09:13 +01:00
|
|
|
{ system, ... }:
|
|
|
|
{
|
|
|
|
baseConfig = { pkgs, ... }: let
|
|
|
|
trivialJob = pkgs.writeTextDir "trivial.nix" ''
|
|
|
|
{ trivial = builtins.derivation {
|
|
|
|
name = "trivial";
|
|
|
|
system = "${system}";
|
|
|
|
builder = "/bin/sh";
|
|
|
|
allowSubstitutes = false;
|
|
|
|
preferLocalBuild = true;
|
|
|
|
args = ["-c" "echo success > $out; exit 0"];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
createTrivialProject = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "create-trivial-project";
|
|
|
|
dontUnpack = true;
|
2022-09-24 23:28:38 +02:00
|
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
2020-03-27 22:09:13 +01:00
|
|
|
installPhase = "install -m755 -D ${./create-trivial-project.sh} $out/bin/create-trivial-project.sh";
|
|
|
|
postFixup = ''
|
2021-01-10 20:08:30 +01:00
|
|
|
wrapProgram "$out/bin/create-trivial-project.sh" --prefix PATH ":" ${pkgs.lib.makeBinPath [ pkgs.curl ]} --set EXPR_PATH ${trivialJob}
|
2020-03-27 22:09:13 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
virtualisation.memorySize = 2048;
|
|
|
|
time.timeZone = "UTC";
|
|
|
|
environment.systemPackages = [ createTrivialProject pkgs.jq ];
|
|
|
|
services.hydra = {
|
|
|
|
enable = true;
|
|
|
|
# Hydra needs those settings to start up, so we add something not harmfull.
|
|
|
|
hydraURL = "example.com";
|
|
|
|
notificationSender = "example@example.com";
|
|
|
|
extraConfig = ''
|
|
|
|
email_notification = 1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
services.postfix.enable = true;
|
|
|
|
nix = {
|
2020-08-04 15:04:03 +02:00
|
|
|
distributedBuilds = true;
|
2020-03-27 22:09:13 +01:00
|
|
|
buildMachines = [{
|
|
|
|
hostName = "localhost";
|
|
|
|
systems = [ system ];
|
|
|
|
}];
|
2021-11-19 23:36:26 +01:00
|
|
|
settings.substituters = [];
|
2020-03-27 22:09:13 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|