use dedicated store partition for hydra builds

This commit is contained in:
Yureka 2024-07-20 15:13:44 +02:00
parent d4f8cb6c87
commit 5bde7e2358
2 changed files with 13 additions and 1 deletions

View file

@ -57,6 +57,11 @@ in
fsType = "xfs";
};
fileSystems."/mnt" = {
device = "/dev/disk/by-label/hydra";
fsType = "xfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
@ -135,6 +140,13 @@ in
MaxStartups = "500:30:1000";
};
systemd.services.hydra-gc = {
description = "Nix Garbage Collector";
script = "exec ${config.nix.package.out}/bin/nix-store --gc --store /mnt";
serviceConfig.Type = "oneshot";
startAt = "hourly";
};
systemd.timers.hydra-gc.timerConfig.Persistent = true;
bagel.sysadmin.enable = true;

View file

@ -14,7 +14,7 @@ let
# XXX: to support Nix's dumb public host key syntax (base64'd), this outputs
# a string with shell-style command interpolations: $(...).
mkBaremetalBuilder = { parallelBuilds, publicHostKey, host, speedFactor ? 1, user ? "builder", supportedSystems ? [ "i686-linux" "x86_64-linux" ], supportedFeatures ? [ "big-parallel" "kvm" "nixos-test" ] }:
"ssh://${user}@${host} ${lib.concatStringsSep "," supportedSystems} ${config.age.secrets.hydra-ssh-key-priv.path} ${toString parallelBuilds} ${toString speedFactor} ${lib.concatStringsSep "," supportedFeatures} - $(echo -n '${publicHostKey}' | base64 -w0)";
"ssh://${user}@${host}?remote-store=/mnt ${lib.concatStringsSep "," supportedSystems} ${config.age.secrets.hydra-ssh-key-priv.path} ${toString parallelBuilds} ${toString speedFactor} ${lib.concatStringsSep "," supportedFeatures} - $(echo -n '${publicHostKey}' | base64 -w0)";
# TODO:
# - generalize to new architectures