feat(remote-build): Add john-endesktop as builder machine
- Enable enableBuilder role on john-endesktop - Add john-endesktop to nix-book's builder list (maxJobs=1, speedFactor=1) - Document SSH setup process for new clients in remote-build role 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,9 @@ with lib;
|
|||||||
# User configuration
|
# User configuration
|
||||||
roles.users.enable = true;
|
roles.users.enable = true;
|
||||||
|
|
||||||
|
# Enable as remote builder (similar to zix790prors)
|
||||||
|
roles.remote-build.enableBuilder = true;
|
||||||
|
|
||||||
# k3s agent configuration
|
# k3s agent configuration
|
||||||
roles.k3s-node = {
|
roles.k3s-node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -21,11 +21,18 @@
|
|||||||
};
|
};
|
||||||
nfs-mounts.enable = true;
|
nfs-mounts.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
remote-build.builders = [{
|
remote-build.builders = [
|
||||||
hostName = "zix790prors";
|
{
|
||||||
maxJobs = 16;
|
hostName = "zix790prors";
|
||||||
speedFactor = 3;
|
maxJobs = 16;
|
||||||
}];
|
speedFactor = 3;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
hostName = "john-endesktop";
|
||||||
|
maxJobs = 1;
|
||||||
|
speedFactor = 1;
|
||||||
|
}
|
||||||
|
];
|
||||||
spotifyd.enable = true;
|
spotifyd.enable = true;
|
||||||
users = {
|
users = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,3 +1,66 @@
|
|||||||
|
# Remote Build Role
|
||||||
|
#
|
||||||
|
# This module configures Nix distributed builds, allowing machines to offload
|
||||||
|
# builds to more powerful remote machines.
|
||||||
|
#
|
||||||
|
# SETUP INSTRUCTIONS
|
||||||
|
# ==================
|
||||||
|
#
|
||||||
|
# 1. BUILDER MACHINE SETUP
|
||||||
|
# On machines that will serve as builders (e.g., zix790prors, john-endesktop):
|
||||||
|
#
|
||||||
|
# a) Enable the builder role in configuration.nix:
|
||||||
|
# roles.remote-build.enableBuilder = true;
|
||||||
|
#
|
||||||
|
# b) After nixos-rebuild, the nix-builder user is created automatically.
|
||||||
|
# You need to add client SSH public keys to the builder. Either:
|
||||||
|
#
|
||||||
|
# Option A - Manual (recommended for initial setup):
|
||||||
|
# sudo mkdir -p /var/lib/nix-builder/.ssh
|
||||||
|
# sudo bash -c 'cat >> /var/lib/nix-builder/.ssh/authorized_keys' << 'EOF'
|
||||||
|
# ssh-ed25519 AAAA... root@client-hostname
|
||||||
|
# EOF
|
||||||
|
# sudo chown -R nix-builder:nix-builder /var/lib/nix-builder/.ssh
|
||||||
|
# sudo chmod 700 /var/lib/nix-builder/.ssh
|
||||||
|
# sudo chmod 600 /var/lib/nix-builder/.ssh/authorized_keys
|
||||||
|
#
|
||||||
|
# Option B - Via NixOS config (if you store keys in the repo):
|
||||||
|
# users.users.nix-builder.openssh.authorizedKeys.keys = [
|
||||||
|
# "ssh-ed25519 AAAA... root@client-hostname"
|
||||||
|
# ];
|
||||||
|
#
|
||||||
|
# 2. CLIENT MACHINE SETUP
|
||||||
|
# On machines that will use remote builders (e.g., nix-book):
|
||||||
|
#
|
||||||
|
# a) Configure builders in configuration.nix:
|
||||||
|
# roles.remote-build.builders = [
|
||||||
|
# {
|
||||||
|
# hostName = "zix790prors";
|
||||||
|
# maxJobs = 16; # Number of parallel build jobs
|
||||||
|
# speedFactor = 3; # Higher = prefer this builder
|
||||||
|
# }
|
||||||
|
# {
|
||||||
|
# hostName = "john-endesktop";
|
||||||
|
# maxJobs = 1; # Conservative for busy machines
|
||||||
|
# speedFactor = 1;
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
#
|
||||||
|
# b) Generate SSH key for root (if not exists) and copy to builders:
|
||||||
|
# sudo ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N ""
|
||||||
|
# sudo cat /root/.ssh/id_ed25519.pub # Add this to builder's authorized_keys
|
||||||
|
#
|
||||||
|
# c) Accept the builder's host key (as root):
|
||||||
|
# sudo ssh nix-builder@zix790prors echo "Connected!"
|
||||||
|
# sudo ssh nix-builder@john-endesktop echo "Connected!"
|
||||||
|
#
|
||||||
|
# 3. VERIFY SETUP
|
||||||
|
# Test that distributed builds work:
|
||||||
|
# nix build --rebuild nixpkgs#hello --print-build-logs
|
||||||
|
#
|
||||||
|
# Check builder connectivity:
|
||||||
|
# nix store ping --store ssh-ng://nix-builder@zix790prors
|
||||||
|
#
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|||||||
Reference in New Issue
Block a user