Files
nixos-setup/hosts/hl-fws1/services/slackerbot.nix
T
ariandClaude Opus 5.5 2a2b1d8421 bazel-build: remote-only builds for slackerbot containers
- Containers get an enforcing bazel wrapper: remote spawn strategy, no
  local fallback, and refused override flags. Gateway rc is written at boot.
- NativeLink: ExecPaths for the DynamicUser state dir (was noexec).
- Bazel server exits after 5 idle minutes; shared per-host repo cache
  (/repo-cache, idmap); goose hints say a local build means trouble.
- Removed the /handoff -> /outputs materializer; outputs download into
  bazel-bin again.
- slackerbot containers: 4G/1 CPU, up to 8G/2 CPUs.
- fws1: disable networkd wait-online.
- slackerbot 4db99ea (send_file symlinked home, trimmed tool lines).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119iKoN3fSvRGUAYHupPW4U
2026-11-01 23:14:35 -05:00

67 lines
2.2 KiB
Nix

{ config, pkgs, skyg-secrets, ... }:
let
homes = "/var/lib/slackerbot/homes";
bazel = config.skyg.nixos.server.services.bazel-build;
settings = {
# The system each container boots (slackerbot's agent + bazel/rbuild);
# updated on every rebuild.
system = "${bazel.agentSystem}";
# Shared Bazel download cache (/repo-cache) for the containers.
rw_binds = bazel.binds.rw;
ro_binds = bazel.binds.ro;
machines_dir = "/var/lib/machines";
state_dir = "/var/lib/slackerbot";
agent_cwd = "/root";
idle_timeout = "6h";
max_idle_timeout = "0s";
allow_indefinite = true;
boot_timeout = "2m";
container = { memory_mb = 4096; cpus = 1.0; };
max_container = { memory_mb = 8192; cpus = 2.0; };
host_reserve = { memory_mb = 8192; cpus = 2.0; };
storage = { min = "2G"; max = "5G"; limit = "20G"; };
drives = [{ path = homes; reserve = "100G"; }];
# Worker of the master on fwdesk. Slack tokens and goose settings come
# from the master. Trusts the first certificate it sees (saved in
# state_dir/master.fingerprint); pin it in master_fingerprint if wanted.
cluster = {
secret = "$CLUSTER_SECRET";
master = "wss://fwdesk.lab.internal:7946";
};
};
in
{
age.secrets.slackerbot-cluster = {
file = skyg-secrets.slackerbot-cluster;
owner = "root";
mode = "0400";
};
# slackerbot flake input; options and docs in its repo.
services.slackerbot = {
enable = true;
mode = "slave";
configFile = (pkgs.formats.toml { }).generate "slackerbot.toml" settings;
environmentFile = config.age.secrets.slackerbot-cluster.path;
};
# Bazel build server for the containers (4 cores / 8 threads).
skyg.nixos.server.services.bazel-build = {
enable = true;
cpuCount = 8;
cacheGB = 50;
};
# Container links belong to systemd-networkd.
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
networking.dhcpcd.denyInterfaces = [ "ve-*" ];
# networkd only has the container links here (NetworkManager owns wlan),
# so wait-online would always time out.
systemd.network.wait-online.enable = false;
systemd.tmpfiles.rules = [ "d ${homes} 0700 root root -" ];
}