Common/nix: add remote builder

This commit is contained in:
Toast 2024-04-24 01:09:08 +02:00
parent 68628028bd
commit 30f41d10db

View file

@ -1,9 +1,38 @@
{systemPkgs, ...}: {
{
systemPkgs,
config,
flakeSelf,
...
}: {
age.secrets = {
remoteBuilderKey.file = "${flakeSelf.inputs.secrets}/WinMax2/nixrbld-private-key.age";
};
programs.ssh = {
knownHosts.winmax2.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE+ksvEq/I2LMLOztVXpLE9yuI6EkRh4EtXdlYkhl6C WinMax2 host key";
extraConfig = ''
Host nixrbld
HostName winmax2
IdentitiesOnly yes
IdentityFile ${config.age.secrets.remoteBuilderKey.path}
User nixrbld
'';
};
nix = {
settings = {
auto-optimise-store = true;
experimental-features = "nix-command flakes";
};
distributedBuilds = true;
buildMachines = [
{
hostName = "nixrbld";
system = "x86_64-linux";
protocol = "ssh-ng";
maxJobs = 4;
}
];
optimise = {
automatic = true;
dates = ["weekly"];