From a60b842ee27f42f73fd19ecc5e0df0e5101c12c1 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 3 Nov 2026 19:21:50 -0500 Subject: [PATCH] more nbot stuff --- flake.lock | 8 +++--- flake.nix | 1 + hosts/hl-fwdesk/services/nbot.nix | 28 +++++++++++++++---- hosts/hl-fws1/services/nbot.nix | 11 ++++---- modules/nixos/server/services/ABOUTME.md | 6 ++++ modules/nixos/server/services/default.nix | 1 + modules/nixos/server/services/nbot-agent.nix | 27 ++++++++++++++++++ secrets.nix | 3 +- secrets/nbot-cluster-hl-fws1.age | Bin 0 -> 402 bytes secrets/nbot-cluster.age | Bin 512 -> 410 bytes secrets/nbot-goose.age | Bin 735 -> 785 bytes 11 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 modules/nixos/server/services/nbot-agent.nix create mode 100644 secrets/nbot-cluster-hl-fws1.age diff --git a/flake.lock b/flake.lock index fb41cb6..33f73f9 100644 --- a/flake.lock +++ b/flake.lock @@ -2338,11 +2338,11 @@ ] }, "locked": { - "lastModified": 1793737222, - "narHash": "sha256-fgVn5aGit0sXhbI3NsZ39rzsrTJuqd0yoBp68+u+B24=", + "lastModified": 1793743562, + "narHash": "sha256-9Uez0aT7Z7mXCkkcXnq+F0F1oYCMAWLhUu7G6Wtldls=", "ref": "refs/heads/main", - "rev": "7a6dc00d41761a7b1a0e0022d9b9060fa96ee477", - "revCount": 79, + "rev": "38c9ec8a69b344025d5b209cfe41b96506327139", + "revCount": 90, "type": "git", "url": "ssh://git@github.com/asosnovsky/nbot.git" }, diff --git a/flake.nix b/flake.nix index ad7a6f4..c6d72d2 100644 --- a/flake.nix +++ b/flake.nix @@ -221,6 +221,7 @@ nbot-slack = ./secrets/nbot-slack.age; nbot-goose = ./secrets/nbot-goose.age; nbot-cluster = ./secrets/nbot-cluster.age; + nbot-cluster-hl-fws1 = ./secrets/nbot-cluster-hl-fws1.age; }; inherit hyprlauncher diff --git a/hosts/hl-fwdesk/services/nbot.nix b/hosts/hl-fwdesk/services/nbot.nix index f663856..42a3440 100644 --- a/hosts/hl-fwdesk/services/nbot.nix +++ b/hosts/hl-fwdesk/services/nbot.nix @@ -1,11 +1,11 @@ -{ config, lib, pkgs, nbot, skyg-secrets, ... }: +{ config, lib, pkgs, skyg-secrets, ... }: let ports = { cluster = 7946; }; homes = "/data/nbot"; secrets = [ "nbot-slack" "nbot-goose" "nbot-cluster" ]; settings = { - # The system each container boots; updated on every rebuild. - system = "${nbot.packages.${pkgs.stdenv.hostPlatform.system}.agent}"; + # The system each container boots (nbot's agent + gh); updated on every rebuild. + system = "${config.skyg.nixos.server.services.nbot-agent.system}"; machines_dir = "/var/lib/machines"; state_dir = "/var/lib/nbot"; agent_cwd = "/root"; @@ -23,6 +23,8 @@ let OPENROUTER_API_KEY = "$OPENROUTER_API_KEY"; CLAUDE_CODE_OAUTH_TOKEN = "$CLAUDE_CODE_OAUTH_TOKEN"; COMMAND_CODE_API_KEY = "$COMMAND_CODE_API_KEY"; + # Every agent can use this PAT, so anyone who can prompt one can too. + GH_TOKEN = "$GH_TOKEN"; }; model_providers = [ @@ -30,14 +32,28 @@ let id = "claude-acp"; name = "Claude ACP (Ari Credentials)"; key_env = "CLAUDE_CODE_OAUTH_TOKEN"; - models = [ "default" "sonnet" "haiku" ]; + models = [ "default" "sonnet" "haiku" "opus" ]; users = [ "U0CBGSS4U6A" ]; } { id = "custom_commandcode"; name = "Command Code"; key_env = "COMMAND_CODE_API_KEY"; - models = [ "deepseek/deepseek-v4-flash" ]; + models = [ + "deepseek/deepseek-v4-flash" + "minimax/minimax-m3.1-flash" + "minimaxai/minimax-m3" + "claude-opus-5-5" + "claude-sonnet-5-5" + "claude-haiku-5-5" + "reflection/beam:free" + "moonshotai/kimi-k3" + "moonshotai/kimi-k2.7-code" + "zai-org/glm-5.3" + "z-ai/glm-5.3-flash" + "xai/grok-4.7" + "gpt-6.1-sol" + ]; } ]; @@ -49,7 +65,7 @@ let drives = [{ path = homes; reserve = "40G"; }]; cluster = { - secret = "$CLUSTER_SECRET"; + node_secrets = { hl-fws1 = "$HL_FWS1_CLUSTER_SECRET"; }; listen = ":${toString ports.cluster}"; }; diff --git a/hosts/hl-fws1/services/nbot.nix b/hosts/hl-fws1/services/nbot.nix index e2359e2..04bdd86 100644 --- a/hosts/hl-fws1/services/nbot.nix +++ b/hosts/hl-fws1/services/nbot.nix @@ -1,9 +1,9 @@ -{ config, pkgs, nbot, skyg-secrets, ... }: +{ config, pkgs, skyg-secrets, ... }: let homes = "/var/lib/nbot/homes"; settings = { - # The system each container boots; updated on every rebuild. - system = "${nbot.packages.${pkgs.stdenv.hostPlatform.system}.agent}"; + # The system each container boots (nbot's agent + gh); updated on every rebuild. + system = "${config.skyg.nixos.server.services.nbot-agent.system}"; machines_dir = "/var/lib/machines"; state_dir = "/var/lib/nbot"; agent_cwd = "/root"; @@ -23,14 +23,15 @@ let # 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"; + name = "hl-fws1"; master = "wss://fwdesk.lab.internal:7946"; + master_fingerprint = "ce08c6b0f3aec855cc8b936d81449c1a34074d181089b26acbdddacfca60af1d"; }; }; in { age.secrets.nbot-cluster = { - file = skyg-secrets.nbot-cluster; + file = skyg-secrets.nbot-cluster-hl-fws1; owner = "root"; mode = "0400"; }; diff --git a/modules/nixos/server/services/ABOUTME.md b/modules/nixos/server/services/ABOUTME.md index 2c7cfc5..aff5a83 100644 --- a/modules/nixos/server/services/ABOUTME.md +++ b/modules/nixos/server/services/ABOUTME.md @@ -14,6 +14,7 @@ services/ ├── bazel-build.nix # skyg.nixos.server.services.bazel-build — NativeLink Bazel build server for slackerbot containers ├── audiobookshelf.nix # skyg.nixos.server.services.audiobookshelf — audiobook/podcast server ├── jellyfin.nix # skyg.nixos.server.services.jellyfin — media server (uid/gid 7777) +├── nbot-agent.nix # skyg.nixos.server.services.nbot-agent — nbot's agent system + gh, for nbot's `system` ├── signal-cli.nix # skyg.nixos.server.services.signal-cli — signal-cli HTTP daemon (Hermes Signal bridge) ├── colibri.nix # skyg.nixos.server.services.colibri — coli serve HTTP API (GLM-5.2/OLMoE local inference) └── comfyui/ # skyg.nixos.server.services.comfyui — ComfyUI with ROCm/CUDA GPU support @@ -67,6 +68,10 @@ services/ own `/root/.cache/bazelisk`. Upstream Bazel only runs on NixOS through `programs.nix-ld`, enabled on the host and in containers. Bump `bazelVersion` and `bazelSha256` together. +- **`nbot-agent.nix`** adds `gh` to nbot's agent system from this repo, leaving the nbot + repo unchanged. `gh` reads `GH_TOKEN` from `agent_env`, and git over HTTPS to github.com + uses it through `gh`. Every container gets that token (chosen on purpose, 2026-11-03), + so anyone who can prompt an agent can use it or ask it to print the token. - **`colibri.nix`** runs `coli serve` (colibrì's OpenAI-compatible API) as a native systemd service. `package` picks the backend (`pkgs.colibri` cpu / `pkgs.colibri-rocm`); `environmentFile` supplies `COLI_API_KEY` via agenix instead of @@ -79,6 +84,7 @@ skyg.nixos.server.services.ai.enable skyg.nixos.server.services.audiobookshelf.{enable,package,configDir,dataDir} skyg.nixos.server.services.bazel-build.{enable,cpuCount,cacheGB,port,agentSystem,binds} skyg.nixos.server.services.jellyfin.enable +skyg.nixos.server.services.nbot-agent.system skyg.nixos.server.services.signal-cli.{enable,host,port,configDir,account,environmentFile,openFirewall} skyg.nixos.server.services.colibri.{enable,package,model,host,port,environmentFile,openFirewall,...} skyg.nixos.server.services.comfyui.{enable,mode,port,openFirewall} diff --git a/modules/nixos/server/services/default.nix b/modules/nixos/server/services/default.nix index eaa1339..7fea907 100644 --- a/modules/nixos/server/services/default.nix +++ b/modules/nixos/server/services/default.nix @@ -7,6 +7,7 @@ ./colibri.nix ./comfyui ./jellyfin.nix + ./nbot-agent.nix ./signal-cli.nix ]; } diff --git a/modules/nixos/server/services/nbot-agent.nix b/modules/nixos/server/services/nbot-agent.nix new file mode 100644 index 0000000..0e3d5c7 --- /dev/null +++ b/modules/nixos/server/services/nbot-agent.nix @@ -0,0 +1,27 @@ +# nbot's agent system with our additions. Use it for nbot's `system`. +{ lib, nbot, ... }: + +with lib; + +let + agentModule = { pkgs, ... }: { + environment.systemPackages = [ pkgs.gh ]; + # gh reads GH_TOKEN (from agent_env); git over HTTPS uses it through gh. + programs.git = { + enable = true; + config.credential."https://github.com".helper = "!${pkgs.gh}/bin/gh auth git-credential"; + }; + }; +in +{ + options.skyg.nixos.server.services.nbot-agent.system = mkOption { + description = "nbot's agent system with gh added. Use for nbot's `system`."; + readOnly = true; + type = types.package; + default = (nbot.nixosConfigurations.agent.extendModules { + modules = [ agentModule ]; + }).config.system.build.toplevel; + # Keeps the manual from building it on every host. + defaultText = literalExpression "nbot agent + gh"; + }; +} diff --git a/secrets.nix b/secrets.nix index 0e1acf3..3df9ee7 100644 --- a/secrets.nix +++ b/secrets.nix @@ -41,7 +41,8 @@ in # nbot (master on fwdesk, worker on fws1) "secrets/nbot-slack.age".publicKeys = [ ari fwdesk ]; "secrets/nbot-goose.age".publicKeys = [ ari fwdesk ]; - "secrets/nbot-cluster.age".publicKeys = [ ari fwdesk fws1 ]; + "secrets/nbot-cluster.age".publicKeys = [ ari fwdesk ]; + "secrets/nbot-cluster-hl-fws1.age".publicKeys = [ ari fws1 ]; # Buzz stack env (minipc1) "secrets/buzz-env.age".publicKeys = [ ari minipc1 ]; diff --git a/secrets/nbot-cluster-hl-fws1.age b/secrets/nbot-cluster-hl-fws1.age new file mode 100644 index 0000000000000000000000000000000000000000..9b164655be3921b10916fe42e0535aa7d5aeb022 GIT binary patch literal 402 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCT4_6#z}byO(zEA&W? zEbt68bdK~XuJ9?+&rS{s4bAo}vGhqd@-Edkjnua^3J)&GGT<_)EH1S$PV`DOck&Ai z&T z)iAL{J1sIJJ*gj&)hsSH@U!|GL$PTyV9fB$(J?9~G14H%J&;RRS64ybudE@ci%DQl{F9^Ui_W0kkKP%m4rY literal 0 HcmV?d00001 diff --git a/secrets/nbot-cluster.age b/secrets/nbot-cluster.age index 2c17f5ac11a60db1fe036819f21ba048230e17f9..a0174d3f93c45932658029b0ccfe308bdf25a193 100644 GIT binary patch delta 375 zcmV--0f_#91eyboEPqEcS~qk~W^`3ga!zGSLwGA;PGd<*c`{C8c4>7@aZXw`HEniI zQf_p3Q3_2&R%%W)YBg?ZW=m%;L1kiRXEbqIGD=BSIc|AFS8Z}MNHlC%M>RBAK?*HC zAaiqQEoEdfH8n9gAZL0^RCjkEP&sN-cWN>=c{xXJSaf$`aDQ`IIYm=?b2nplSZj7K zS5QhYXGB9nbuu$a3V153N0-yAXrB;FHBHmYgkS*P%%PzZ#G9$N-{}HL`pPKXn0O+Za7U=a#eG6OjA#5 z3fgxTskY``%5bTkf^cVS@~m+=yGvy8P=vp4R>MxuoA8`JJM_nbD{K|AW&+4l?Zz{# z=mRqaM6K1CrQa99d0C00jEQF{`L-Tfaq52thWbtRl7i5PR6&22`F;s9@m^8Ktq0yC VKnD*(WS_5Ma0h#`bb zHb@WjmK`)$E)@GoDEcWLNRv(nVwx%l*<8(){81uoNje*4Oc7dcKOAfZR513`Ql2oz z6^f~2E)@PAo@ux);wahtbW9Uf>O(Is{U=>E~-D zt2Xl`Y@(=9EtMFXp`L6zY?zXbu&TAGh9a9qsaqE$bvU1yTE!rie1#*T&H0Q&f!PqvG^TbKrvWTNrahxiBZ{RH-Z*OrMIwlp z^`0t^EI43usd^e=BuU~*uTy~{hbnD)$~hX!RO{I&YkE|==Xr&RJ?bVTR8V7=h1kar z(0KfgN$OyK_vm|f`{Xd*zxnh2^F4F<_Y*%`U0i)%+&J~13(g%{(+#+_`x$-9UtRn2 zdgt^@NZ-5OTCSZxe0KKMkuSX;@sd3w@0Bk-eZLB)8~^|S diff --git a/secrets/nbot-goose.age b/secrets/nbot-goose.age index f99f8d7e09612923fdae82e0a343724f7738355a..626b72202e4654ba7c508ca8e40ed95870f74f41 100644 GIT binary patch delta 753 zcmVYEV%ydPFvFIe0l_FgHs#V|qw*OHfr)V{>CcICf4kL330zGC@yDSqd#a zAaiqQEoEdfH8n9gAZL0^RCjkEX;U(HZbEZ5a!5xsZYwiTMSpowcT-DLZ%a=wXj4f= zRYqAwa8PP^F=<9k3T8rXIBrU4cy%*maWgq)N>)uzRA_8yD>p?lGEy*PL31@`G-`NP zb4yf73N0-yAZkG`SvgKCX;fivV{AoPNkTz+XJb}Hb!l%>aC1v#H&$3_acVL)F;Q(r z3el%KD`TFma(`AjF@=XBPnRryrN;K(h(9bSc^34+8>xEP!$d>uSGuwS`7AMTK`3iu z@MWV>(JxreX3KJ!e+6*OYLqT#iYj1G2S%mqU6KbraIoPuteEhNnsro#xL(H*1im0L z!Cs`$=3+VQ>%sUSXcx03DyD1DZLvKOtYZF)g^(bt=-aEM^|~d&obbf% z&}(nO#((%Ff!zB&t#PWgv*OJJN0x!Q|IpgXNEy*TiL7YFubT4qt5Zf5{C@DpLGZANFmW!Y4x>a zMsYawHtE<+Cb7}KlrenaJNf%d*1|wJXM3jT^V7(H@MM*LS-Y)dvsLN8%VMo~;^I7Kx`HD_{V zXF*D53N0-yAX!aIHZfvGL`Fd|YByncVo5Y}H%&)pae7W!R!(wIWj9u0aBEO!HZ)>q z3I;gSY`IGmjHT%7R zchC4Scl!zOU~=_g>~+50N|Xn#p|ZjZnktJ@Ei@aq8ffLS9k1R2tk1?a$55wdJBTHU zD