ops/nixos: whitby-distributed
This commit is contained in:
parent
c5d4542bbb
commit
6d24fe6e78
4 changed files with 44 additions and 19 deletions
|
@ -47,6 +47,7 @@ in
|
|||
imports = [
|
||||
../lib/zfs.nix
|
||||
../lib/bgp.nix
|
||||
../lib/whitby-distributed.nix
|
||||
../lib/nixbuild-distributed.nix
|
||||
../lib/gitlab-runner-cacher.nix
|
||||
../lib/coredns/default.nix
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./vault-agent-secrets.nix ];
|
||||
imports = [ ./nixbuild-key.nix ];
|
||||
|
||||
# Distributed builds!
|
||||
nix.buildMachines = lib.mkAfter [{
|
||||
|
@ -27,22 +27,6 @@
|
|||
builders-use-substitutes = true
|
||||
'';
|
||||
|
||||
my.vault.secrets.id_ed25519_nixbuild = {
|
||||
group = "users";
|
||||
template = ''
|
||||
{{ with secret "kv/apps/nixbuild" -}}
|
||||
{{ .Data.data.id_ed25519_nixbuild }}
|
||||
{{- end }}
|
||||
'';
|
||||
};
|
||||
my.vault.secrets."id_ed25519_nixbuild.pub" = {
|
||||
group = "users";
|
||||
template = ''
|
||||
{{ with secret "kv/apps/nixbuild" -}}
|
||||
{{ .Data.data.id_ed25519_nixbuild_pub }}
|
||||
{{- end }}
|
||||
'';
|
||||
};
|
||||
programs.ssh.extraConfig = ''
|
||||
Host eu.nixbuild.net
|
||||
PubkeyAcceptedKeyTypes ssh-ed25519
|
||||
|
|
25
ops/nixos/lib/nixbuild-key.nix
Normal file
25
ops/nixos/lib/nixbuild-key.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
# SPDX-FileCopyrightText: 2023 Luke Granger-Brown <depot@lukegb.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./vault-agent-secrets.nix ];
|
||||
|
||||
my.vault.secrets.id_ed25519_nixbuild = {
|
||||
group = "users";
|
||||
template = ''
|
||||
{{ with secret "kv/apps/nixbuild" -}}
|
||||
{{ .Data.data.id_ed25519_nixbuild }}
|
||||
{{- end }}
|
||||
'';
|
||||
};
|
||||
my.vault.secrets."id_ed25519_nixbuild.pub" = {
|
||||
group = "users";
|
||||
template = ''
|
||||
{{ with secret "kv/apps/nixbuild" -}}
|
||||
{{ .Data.data.id_ed25519_nixbuild_pub }}
|
||||
{{- end }}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -2,11 +2,13 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
{ lib, ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [ ./nixbuild-key.nix ];
|
||||
|
||||
# Distributed builds!
|
||||
nix.buildMachines = lib.mkAfter [ {
|
||||
hostName = "whitby";
|
||||
hostName = "whitby-build";
|
||||
system = "x86_64-linux";
|
||||
maxJobs = 64;
|
||||
speedFactor = 4;
|
||||
|
@ -17,4 +19,17 @@
|
|||
nix.extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
|
||||
programs.ssh.extraConfig = ''
|
||||
Host whitby-build
|
||||
User lukegb
|
||||
PubkeyAcceptedKeyTypes ssh-ed25519
|
||||
IdentityFile ${config.my.vault.secrets.id_ed25519_nixbuild.path}
|
||||
'';
|
||||
programs.ssh.knownHosts = {
|
||||
whitby-build = {
|
||||
hostNames = [ "whitby.tvl.fyi" "whitby-build" ];
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILNh/w4BSKov0jdz3gKBc98tpoLta5bb87fQXWBhAl2I";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue