goose knows about nix

This commit is contained in:
ari committed 2026-11-01 15:21:43 -05:00
1 parent 25fcf85855
commit 25f648d606
8 files changed
+35 -11

No files matched your search

+9
View File
@@ -24,6 +24,14 @@ const sendFileHelp = "Send a file to the user in Slack: images, videos, PDFs, ar
"It's uploaded into the conversation when your turn ends, so mention it in your reply. " +
"At most a few files per turn."
const instructions = `This container runs NixOS with only a few tools installed. Nix is available with flakes, and builds run through the host. Use it for every toolchain and dependency:
- For a new project, write a flake.nix with a devShells.default that provides everything the project needs (and packages.default if it builds something), then run commands with ` + "`nix develop -c <command>`" + `.
- In an existing project without a flake.nix, add one before installing anything.
- Flakes only see files tracked by git, so ` + "`git init`" + ` and ` + "`git add`" + ` new files, including flake.nix and flake.lock, before building.
- For a one-off tool, use ` + "`nix shell nixpkgs#<package> -c <command>`" + `.
- Don't install things globally (nix-env, nix profile, pip install --user, npm install -g): only the home folder survives a restart.
- The host may garbage-collect build outputs, so rebuild instead of relying on old result links.`
const commandNote = " It's the same as the Slack command `%s`, and runs with the permissions of the person whose message you're answering."
const (
@@ -168,6 +176,7 @@ func (s *Server) handle(m msg) (any, *rpcError) {
"protocolVersion": p.ProtocolVersion,
"capabilities": map[string]any{"tools": map[string]any{}},
"serverInfo": map[string]string{"name": ServerName, "version": "1"},
"instructions": instructions,
}, nil
case "ping":
return map[string]any{}, nil
+1 -1
View File
@@ -29,7 +29,7 @@ func TestSendFileTool(t *testing.T) {
t.Fatal(err)
}
lines := strings.Split(strings.TrimSpace(out.String()), "\n")
if len(lines) != 5 || !strings.Contains(lines[0], `"protocolVersion":"2025-06-18"`) {
if len(lines) != 5 || !strings.Contains(lines[0], `"protocolVersion":"2025-06-18"`) || !strings.Contains(lines[0], "devShells.default") {
t.Fatalf("replies: %v", lines)
}
want := []struct {