diff --git a/flake.lock b/flake.lock index 25f2f70..592f592 100644 --- a/flake.lock +++ b/flake.lock @@ -2204,11 +2204,11 @@ ] }, "locked": { - "lastModified": 1793984825, - "narHash": "sha256-cmhGM7E19/QM4BLj4SXfML32EUe8DOrzo6wDGjV5QLI=", + "lastModified": 1794057087, + "narHash": "sha256-UlrEHt0pFD2AXuleAKUmf6lD2Pih8+jCbxWxpEz05LA=", "ref": "refs/heads/main", - "rev": "8daeca5189778c9d08f83519c07e08c6de95c605", - "revCount": 492, + "rev": "a6451cb0fa240d23f280c991d3d21e2784618b42", + "revCount": 652, "type": "git", "url": "ssh://git@github.com/asosnovsky/nbot.git" }, diff --git a/hosts/hl-fwdesk/services/nbot.nix b/hosts/hl-fwdesk/services/nbot.nix index 762847e..e075dce 100644 --- a/hosts/hl-fwdesk/services/nbot.nix +++ b/hosts/hl-fwdesk/services/nbot.nix @@ -15,8 +15,8 @@ let allow_indefinite = true; boot_timeout = "2m"; + # Summaries are always on now; only the model and its timeout are set. summaries = { - enabled = true; timeout = "10s"; }; @@ -92,7 +92,10 @@ let max_container = { memory_mb = 16384; cpus = 4; }; host_reserve = { memory_mb = 32768; cpus = 4.0; }; storage = { min = "2G"; max = "5G"; limit = "20G"; }; - drives = [{ path = homes; reserve = "40G"; }]; + # allow_subdir: the folder is a plain folder on the /data disk. The unit + # waits for that disk (services.nbot.drives), which is what the check in + # nbot is for. + drives = [{ path = homes; reserve = "40G"; allow_subdir = true; }]; cluster = { node_secrets = { hl-fws1 = "$HL_FWS1_CLUSTER_SECRET"; }; @@ -118,6 +121,9 @@ in enable = true; mode = "master"; clusterPort = ports.cluster; + # The unit waits for these mounts before it starts. + drives = [ homes ]; + stateDir = "/var/lib/nbot"; configFile = (pkgs.formats.toml { }).generate "nbot.toml" settings; }; diff --git a/hosts/hl-fws1/services/nbot.nix b/hosts/hl-fws1/services/nbot.nix index 3aaee4a..769a868 100644 --- a/hosts/hl-fws1/services/nbot.nix +++ b/hosts/hl-fws1/services/nbot.nix @@ -17,7 +17,8 @@ let max_container = { memory_mb = 51200; cpus = 6; }; host_reserve = { memory_mb = 8192; cpus = 2.0; }; storage = { min = "2G"; max = "10G"; limit = "50G"; }; - drives = [{ path = homes; reserve = "200G"; }]; + # allow_subdir: the folder is a plain folder on the root disk. + drives = [{ path = homes; reserve = "200G"; allow_subdir = true; }]; # Worker of the master on fwdesk. Slack tokens and goose settings come # from the master. Trusts the first certificate it sees (saved in @@ -25,7 +26,9 @@ let cluster = { name = "hl-fws1"; master = "wss://fwdesk.lab.internal:7946"; - master_fingerprint = "ce08c6b0f3aec855cc8b936d81449c1a34074d181089b26acbdddacfca60af1d"; + # A list, so the master's certificate can be rotated with no time where + # a slave refuses the master: add the new fingerprint, then drop the old. + master_fingerprint = [ "ce08c6b0f3aec855cc8b936d81449c1a34074d181089b26acbdddacfca60af1d" ]; }; }; in @@ -40,6 +43,9 @@ in services.nbot = { enable = true; mode = "slave"; + # The unit waits for these mounts before it starts. + drives = [ homes ]; + stateDir = "/var/lib/nbot"; configFile = (pkgs.formats.toml { }).generate "nbot.toml" settings; environmentFile = config.age.secrets.nbot-cluster.path; };