feat: distributed builder work

This commit is contained in:
Kat Inskip 2023-01-30 08:02:10 -08:00
parent 08fbb97b5a
commit b01c6222f8
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
7 changed files with 63 additions and 79 deletions

View file

@ -1,27 +1,14 @@
_: let
hostConfig = { lib, ... }: let
hostConfig = { lib, tree, ... }: let
inherit (lib.modules) mkDefault;
in {
imports = [
imports = with tree; [
nixos.rosetta
];
boot = {
systemd-boot.enable = true;
initrd = {
availableKernelModules = ["virtio_pci" "xhci_pci" "usb_storage" "usbhid" "virtiofs"];
};
nix.settings = {
extra-platforms = [ "x86_64-linux" ];
extra-sandbox-paths = [ "/run/rosetta" "/run/binfmt" ];
};
binfmt.registrations."rosetta" = {
interpreter = "/run/rosetta/rosetta";
fixBinary = true;
wrapInterpreterInShell = false;
matchCredentials = true;
magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00'';
mask = ''\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'';
};
loader.systemd-boot.enable = true;
initrd.availableKernelModules = ["virtio_pci" "xhci_pci" "usb_storage" "usbhid" ];
};
fileSystems = {
@ -51,7 +38,7 @@ _: let
system.stateVersion = "22.11";
};
in {
arch = "aarch64-linux";
arch = "aarch64";
type = "NixOS";
modules = [
hostConfig

View file

@ -2,65 +2,11 @@ _: let
hostConfig = {tree, pkgs, ...}: {
imports = with tree; [
kat.work
darwin.distributed
];
security.pam.enableSudoTouchIdAuth = true;
home-manager.users = let
commonUser = {
programs.ssh = {
enable = true;
matchBlocks = {
"koishi.inskip.me" = {
hostname = "koishi.inskip.me";
port = 22;
user = "root";
};
"daiyousei.inskip.me" = {
hostname = "daiyousei.inskip.me";
port = 62954;
user = "root";
};
"renko-build" = {
hostname = "192.168.64.3";
port = 62954;
user = "root";
};
};
};
};
in {
kat = commonUser;
root = commonUser;
};
nix = {
envVars = {
"SSH_AUTH_SOCK" = "/Users/kat/.gnupg/S.gpg-agent.ssh";
};
buildMachines = [
{
hostName = "koishi.inskip.me";
sshUser = "deploy";
system = "x86_64-linux";
maxJobs = 100;
speedFactor = 1;
supportedFeatures = ["benchmark" "big-parallel" "kvm"];
mandatoryFeatures = [];
}
{
hostName = "daiyousei-build";
sshUser = "root";
system = "aarch64-linux";
maxJobs = 100;
speedFactor = 1;
supportedFeatures = ["benchmark" "big-parallel" "kvm"];
mandatoryFeatures = [];
}
];
distributedBuilds = true;
};
homebrew = {
brewPrefix = "/opt/homebrew/bin";
brews = [