Ok, distributed. Maybe.

This commit is contained in:
Bun 2025-06-09 18:24:51 -04:00
parent 4e145a70d9
commit 9191593dc7
9 changed files with 76 additions and 47 deletions

View file

@ -68,9 +68,6 @@
nixpkgs = import stable { system = "x86_64-linux"; };
specialArgs = inputs;
# Remote builds
machinesFile = ./machines.txt;
# Use a different Nixpkgs import on some systems
nodeNixpkgs.jupiter = import unstable { system = "x86_64-linux"; };
};

View file

@ -14,7 +14,10 @@
stateVersion = "24.05";
};
deployment.targetHost = "42f:2737:2aed:4dee:cbe4:3c73:1918:ad9b";
deployment = {
buildOnTarget = true;
targetHost = "42f:2737:2aed:4dee:cbe4:3c73:1918:ad9b";
};
networking.hostId = "97a21a38";
}

View file

@ -1,5 +0,0 @@
ssh://midas x86_64-linux
ssh://kitty x86_64-linux
ssh://detritus x86_64-linux
ssh://elder x86_64-linux
ssh://prophet aarch64-linux

View file

@ -5,17 +5,10 @@
addKeysToAgent = "yes";
compression = true;
matchBlocks = {
# Personal devices
tower.hostname = "4e4:535:9d47:f367:becd:6557:458d:5b1b";
intuos.hostname = "40e:404:a427:da33:163e:97b3:a2a3:9ed4";
jupiter.hostname = "5ce:969c:40d1:9575:f5e:591d:c377:a20b";
# Personal servers
midas.hostname = "538:e163:87ba:f847:3646:18b6:6b01:d8f8";
kitty.hostname = "53f:dc2d:80c9:3ca2:4b15:ef4d:38a0:c868";
detritus.hostname = "5dd:9cd7:f286:e2c7:4c3b:c2e1:7832:97a3";
elder.hostname = "570:3651:7f2:c26b:bccd:725b:be00:8a18";
prophet.hostname = "42f:2737:2aed:4dee:cbe4:3c73:1918:ad9b";
sv1.hostname = "sv1.nixfox.ca";
sv2.hostname = "sv2.nixfox.ca";
mx.hostname = "mx.nixfox.ca";
# Other servers
bloxel.hostname = "rtmp.bloxelcom.net";

View file

@ -1,6 +1,7 @@
{ config, ... }:
{
imports = [
./hosts
./mounts
./mycelium
./nameservers

View file

@ -0,0 +1,10 @@
{ config, lib, nodes, ... }:
{
networking.hosts = with nodes; {
"${midas.config.deployment.targetHost}" = [ "midas" ];
"${kitty.config.deployment.targetHost}" = [ "kitty" ];
"${detritus.config.deployment.targetHost}" = [ "detritus" ];
"${elder.config.deployment.targetHost}" = [ "elder" ];
"${prophet.config.deployment.targetHost}" = [ "prophet" ];
};
}

View file

@ -1,41 +1,34 @@
{ config, lib, nodes, ... }:
{
fileSystems = let
netOpts = [
"noauto"
"soft"
"x-systemd.automount"
];
common = {
fsType = "nfs4";
options = [
"noauto"
"soft"
"x-systemd.automount"
];
};
in with nodes; {
"midas" = {
device = "[${midas.config.deployment.targetHost}]:/storage";
"midas" = common // {
device = "midas:/storage";
mountPoint = "/network/Midas";
fsType = "nfs4";
options = netOpts;
};
"kitty" = {
device = "[${kitty.config.deployment.targetHost}]:/storage";
"kitty" = common // {
device = "kitty:/storage";
mountPoint = "/network/Kitty";
fsType = "nfs4";
options = netOpts;
};
"detritus" = {
device = "[${detritus.config.deployment.targetHost}]:/storage";
"detritus" = common // {
device = "detritus:/storage";
mountPoint = "/network/Detritus";
fsType = "nfs4";
options = netOpts;
};
"elder" = {
device = "[${elder.config.deployment.targetHost}]:/storage";
"elder" = common // {
device = "elder:/storage";
mountPoint = "/network/Elder";
fsType = "nfs4";
options = netOpts;
};
"prophet" = {
device = "[${prophet.config.deployment.targetHost}]:/storage";
"prophet" = common // {
device = "prophet:/storage";
mountPoint = "/network/Prophet";
fsType = "nfs4";
options = netOpts;
};
};
}

View file

@ -2,6 +2,7 @@
{
imports = [
./channels
./distributed
./gc
./unfree
];
@ -14,10 +15,7 @@
"nix-command"
"flakes"
];
max-jobs = 0;
trusted-users = [ "root" ];
};
distributedBuilds = true;
};
# Use a newer implementation of nixos-rebuild

View file

@ -0,0 +1,39 @@
{ nodes, ... }:
{
nix = {
buildMachines = with nodes; [
{
hostName = midas.config.deployment.targetHost;
system = midas.config.nixpkgs.localSystem.system;
publicHostKey = "AAAAC3NzaC1lZDI1NTE5AAAAIFcFMvrx9/iUZ1mEubf+QF1i3LNTxFhaU/1zFSjdo0kK";
protocol = "ssh-ng";
}
{
hostName = kitty.config.deployment.targetHost;
system = kitty.config.nixpkgs.localSystem.system;
publicHostKey = "AAAAC3NzaC1lZDI1NTE5AAAAIIrGmsya5DXKuXO6jNjUlrYHqk49KLzxM/60GXtLRLrL";
protocol = "ssh-ng";
}
{
hostName = detritus.config.deployment.targetHost;
system = detritus.config.nixpkgs.localSystem.system;
publicHostKey = "AAAAC3NzaC1lZDI1NTE5AAAAIN+GvLro4DVmlvmXcasU1gctIX9qct7mZtElpB735AoL";
protocol = "ssh-ng";
}
{
hostName = elder.config.deployment.targetHost;
system = elder.config.nixpkgs.localSystem.system;
publicHostKey = "AAAAC3NzaC1lZDI1NTE5AAAAIFjmJ6bkuO57gp6GZDEfR1O7krdf5wiqrOBC5pzTDl91";
protocol = "ssh-ng";
}
{
hostName = prophet.config.deployment.targetHost;
system = prophet.config.nixpkgs.localSystem.system;
publicHostKey = "AAAAC3NzaC1lZDI1NTE5AAAAICrp3Y/X2BRUENx+0GMTmB1VDA6SiwkGgdJMHSdMMepM";
protocol = "ssh-ng";
}
];
distributedBuilds = true;
settings.trusted-users = [ "root" ];
};
}