ci: register GC roots

This commit is contained in:
tv 2018-11-13 21:38:28 +01:00
parent 78cbcb1e95
commit ddfddbe756

View File

@ -30,6 +30,8 @@ let
nix-instantiate --quiet -Q --eval --strict --json ./ci.nix nix-instantiate --quiet -Q --eval --strict --json ./ci.nix
''; '';
profileRoot = "/nix/var/nix/profiles/ci";
imp = { imp = {
krebs.buildbot.master = { krebs.buildbot.master = {
slaves = { slaves = {
@ -98,9 +100,16 @@ let
self.addBuildSteps([steps.ShellCommand( self.addBuildSteps([steps.ShellCommand(
name=str(new_step), name=str(new_step),
command=[ command=[
new_steps[new_step] "${pkgs.writeDash "build-stepper.sh" ''
set -efu
profile=${shell.escape profileRoot}/$build_name
result=$("$build_script")
${pkgs.nix}/bin/nix-env -p "$profile" --set "$result"
''}"
], ],
env={ env={
"build_name": new_step,
"build_script": new_steps[new_step],
"NIX_REMOTE": "daemon", "NIX_REMOTE": "daemon",
"NIX_PATH": "secrets=/var/src/stockholm/null:/var/src", "NIX_PATH": "secrets=/var/src/stockholm/null:/var/src",
}, },
@ -163,6 +172,20 @@ let
password = "lasspass"; password = "lasspass";
packages = with pkgs; [ gnumake jq nix populate gnutar lzma gzip ]; packages = with pkgs; [ gnumake jq nix populate gnutar lzma gzip ];
}; };
system.activationScripts.buildbots-nix-profile = ''
${pkgs.coreutils}/bin/mkdir -p ${shell.escape profileRoot}
${pkgs.coreutils}/bin/chmod 0770 ${shell.escape profileRoot}
${pkgs.coreutils}/bin/chgrp buildbots ${shell.escape profileRoot}
'';
users = {
groups.buildbots.gid = genid "buildbots";
users = {
buildbotMaster.extraGroups = [ "buildbots" ];
buildbotSlave.extraGroups = [ "buildbots" ];
};
};
}; };
in out in out