diff --git a/AGENTS.md b/AGENTS.md index 2926584..f772693 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,8 +8,9 @@ A flake-based NixOS configuration managing 8 hosts (all x86_64-linux). Pinned to ## Common Commands -- **Build/deploy locally**: `rebuild-nixos` (installed to `~/.local/bin` via `make`) - - This runs on the target machine: pulls from local git remote, then `doas nixos-rebuild switch --flake .` +- **Build/deploy locally**: commit the working tree, then `rebuild-nixos` (installed to `~/.local/bin` via `make`) + - `rebuild-nixos` pulls committed `master` from the local git remote into `/etc/nixos`, then `doas nixos-rebuild switch --flake .` + - Uncommitted changes are not deployed. Do not `nixos-rebuild switch` against the working tree. - **Build a specific host** (dry run): `nixos-rebuild build --flake .#` - **Flash a remote machine**: `./script/flash.sh ` (uses nixos-anywhere) - **Check if reboot needed**: `./script/check-restart.sh` diff --git a/CLAUDE.md b/CLAUDE.md index 2926584..f772693 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,8 +8,9 @@ A flake-based NixOS configuration managing 8 hosts (all x86_64-linux). Pinned to ## Common Commands -- **Build/deploy locally**: `rebuild-nixos` (installed to `~/.local/bin` via `make`) - - This runs on the target machine: pulls from local git remote, then `doas nixos-rebuild switch --flake .` +- **Build/deploy locally**: commit the working tree, then `rebuild-nixos` (installed to `~/.local/bin` via `make`) + - `rebuild-nixos` pulls committed `master` from the local git remote into `/etc/nixos`, then `doas nixos-rebuild switch --flake .` + - Uncommitted changes are not deployed. Do not `nixos-rebuild switch` against the working tree. - **Build a specific host** (dry run): `nixos-rebuild build --flake .#` - **Flash a remote machine**: `./script/flash.sh ` (uses nixos-anywhere) - **Check if reboot needed**: `./script/check-restart.sh` diff --git a/hw/straylight/default.nix b/hw/straylight/default.nix index a41a291..eed629e 100644 --- a/hw/straylight/default.nix +++ b/hw/straylight/default.nix @@ -121,9 +121,12 @@ in HF_HOME = "/var/lib/llama-server/huggingface"; }; serviceConfig = { + # Bind all interfaces so localhost and the tailnet can both reach the + # OpenAI-compatible API. LAN access is still blocked: 11434 is opened + # only on tailscale0, not in the global allowedTCPPorts list. ExecStart = '' ${llama-cpp}/bin/llama-server \ - --host 127.0.0.1 \ + --host 0.0.0.0 \ --port 11434 \ --models-preset ${llamaModelsIni} \ --models-max 2 @@ -212,6 +215,8 @@ in # Open ports: DNS (53), mc-proxy (443/8443/9443), agent (9444), master (9555), open-webui (8080). networking.firewall.allowedTCPPorts = [ 53 443 8080 8443 9443 9444 9555 ]; networking.firewall.allowedUDPPorts = [ 53 ]; + # llama.cpp OpenAI-compatible API: tailnet only (localhost is always allowed). + networking.firewall.interfaces.tailscale0.allowedTCPPorts = [ 11434 ]; # DNS: MCNS for internal zones, public resolvers as fallback. networking.nameservers = [