Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AI Assistants

Platforms: Claude Code, Codex, the project environment, T3 Code in both its modes, Ollama, the shared context and the MCP servers run on NixOS and nix-darwin, and Claude Desktop and Orca are NixOS only. Paseo’s CLI, daemon and desktop app run on NixOS and on aarch64-darwin. See Darwin.

AI assistant modules under othrys.apps.ai.*. Located in modules/apps/cli/ai/.

Available Modules

ModuleOptionDescription
Claude Codeothrys.apps.ai.claude-codeAnthropic CLI assistant
Codexothrys.apps.ai.codexOpenAI CLI assistant
Project environmentothrys.apps.ai.projectEnvironmentStarts Claude Code and Codex in the direnv environment of the directory they start in
Claude Desktopothrys.apps.ai.claude-desktopAnthropic’s desktop app, which also runs Claude Code sessions
Orcaothrys.apps.ai.orcaDesktop app that runs coding agents side by side in git worktrees
T3 Codeothrys.apps.ai.t3codeWeb and desktop interface to Codex and Claude Code, served headless or run as a desktop app
Paseoothrys.apps.ai.paseoDaemon, CLI and desktop app that run Codex and Claude Code agents, with a direnv plugin
Ollamaothrys.apps.ai.ollamaLocal LLM inference server, with the backend chosen from the host’s GPU
MCP Context7othrys.apps.ai.mcp.context7Context7 documentation MCP server

Where the AI packages come from

The packages of othrys.apps.ai.claude-code, othrys.apps.ai.codex, othrys.apps.ai.claude-desktop, othrys.apps.ai.orca and othrys.apps.ai.t3code default to the builds in the llm-agents flake this library locks. That flake follows each vendor’s releases within hours, while nixpkgs typically trails by days. It builds against its own nixpkgs, so its packages come prebuilt from cache.numtide.com, and a host trusts that cache and its key only while such a module is on. package takes any other build, such as pkgs.claude-code. othrys.apps.ai.paseo is the exception and defaults to nixpkgs’ paseo, since the llm-agents build leaves out the web UI the daemon serves (numtide/llm-agents.nix#12308).

The default is built with disableTelemetry, which turns off telemetry and non-essential traffic, and othrys.apps.ai.claude-code.disableTelemetry = false builds it without. A package set by hand is used as given.

Every module that installs or runs Claude Code or Codex, T3 Code and Paseo among them, receives the package wrapped by the launcher that the project environment describes, whether it is the default or one set by hand. A host that sets Home Manager’s programs.claude-code.package or programs.codex.package itself replaces the wrapped package for that user.

llm-agents marks its unfree packages as free, so nixpkgs never asks whether the host admits them. Claude Code and Claude Desktop are unfree, so their modules refuse a host that admits no unfree software, through othrys.system.nix.allowUnfree or the host’s own allowUnfreePredicate or allowUnfreePackages.

The project environment

An agent inherits the environment of whatever started it, such as a daemon, an editor or a shell outside the project. A project whose agent hooks or tools live in its dev shell then fails. In othrys.nix itself, .claude/settings.json refuses every write when othrys-agent-hook is not on PATH. othrys.apps.ai.projectEnvironment, on by default, replaces the claude and codex programs of their packages with a launcher. When the directory the agent starts in has an allowed .envrc, the launcher runs the agent through direnv exec, so it gets the environment a shell in that directory would have, and variables direnv unsets are unset as usual.

The launcher leaves the agent unchanged in a directory without an .envrc, and when DIRENV_DIR names the directory of the .envrc direnv finds from there, since direnv has loaded that environment already. An environment loaded for a parent project does not count when the directory has an .envrc of its own. In an interactive shell inside the project it therefore does nothing beyond what direnv’s own hook did. It runs direnv, jq, git, coreutils and diffutils from the store, so a host without direnv in its profile still runs it, while no .envrc is allowed until the user runs direnv allow.

A blocked .envrc makes direnv exec refuse to run the command at all. The launcher then starts the agent without the environment and prints one line to stderr naming the file. direnv allow in that directory loads it from the next start.

direnv trusts an .envrc by its path, so every new git worktree starts blocked. The launcher allows a worktree’s .envrc when it is byte-identical to the .envrc at the same relative path in the main checkout and that file is allowed, which extends trust only to text the user already approved. A worktree whose .envrc differs stays blocked until direnv allow. The main checkout is found through git rev-parse --git-common-dir, so a worktree of a bare repository or of a submodule is not covered and starts blocked. A worktree the user denied with direnv deny stays denied.

The allow is written to the user’s direnv allow store under $XDG_DATA_HOME/direnv/allow, so it outlasts the agent, and a shell that enters the worktree later loads the file without a prompt. Removing the worktree leaves the entry until direnv prune runs. A host that wants new worktrees to stay blocked until the user allows them sets othrys.apps.ai.projectEnvironment.trustWorktrees = false, and the launcher then never runs direnv allow.

The trust is direnv’s own model, and direnv hashes .envrc alone. Under use flake, a branch that changes flake.nix or the dev shell loads without a prompt, in the main checkout and in a worktree that inherited the trust alike.

The environment belongs to the process and is chosen by the directory the agent starts in. A program that runs one agent process for several directories, or starts the process in its own directory rather than the project’s, gets the environment of that directory only. Such launchers need their own support.

othrys.apps.ai.projectEnvironment.enable = false gives every module the packages as they are set.

Options

  options.othrys.apps.ai.projectEnvironment = {
    enable = lib.mkOption {
      type = lib.types.bool;
      default = true;
      description = ''
        Start `claude` and `codex` through `direnv exec` when the directory
        they start in has an allowed `.envrc`, so their hooks and commands
        see the project's environment whichever program started them. A
        directory without an `.envrc` and an environment direnv already
        loaded leave the agent unchanged.
      '';
    };

    trustWorktrees = lib.mkOption {
      type = lib.types.bool;
      default = true;
      description = ''
        When an agent starts in a git worktree, run `direnv allow` on its
        `.envrc` when it is identical to the allowed `.envrc` at the same
        place in the main checkout. The allow is written to the user's
        direnv allow store, so it outlasts the agent and a shell in the
        worktree loads the file too. When false, a new worktree's `.envrc`
        stays blocked until the user allows it. Has no effect while
        `enable` is off.
      '';
    };
  };

Codex

othrys.apps.ai.codex wraps Home Manager’s programs.codex. It receives the shared skills, the shared context as its global AGENTS.md, and every server under programs.mcp.servers. othrys.apps.ai.codex.skills holds skills for Codex alone.

disableTelemetry, on by default, turns off Codex’s analytics and the metrics exporter that follows them, /feedback uploads, and the startup check that asks GitHub for a newer release a Nix-managed binary cannot install. othrys.apps.ai.codex.settings is merged over what the module writes and wins over it.

How Codex’s permissions follow Claude Code’s

Codex confines commands with a sandbox where Claude Code prompts for them, so the module carries Claude Code’s choices over in Codex’s own terms.

  • Mode. permissions.mode takes Claude Code’s two mode names. With "default" the workspace stays read-only and every edit asks first. With "acceptEdits" Codex edits the workspace without asking and also runs commands without asking, inside a sandbox with no network that writes only to the workspace. Codex has no mode that applies edits freely while prompting for every command. In both modes, leaving the sandbox asks first.
  • Read denials. permissions.denyRead keeps sandboxed commands from reading .env, .env.* and secrets/**, as Claude Code’s deny list does. Codex expresses that only through its permission profiles, which it marks as Beta, so the module writes a profile named othrys that extends the built-in one the mode names. A command run outside the sandbox is not bound by it.
  • Command rules. sudo and rm -rf are forbidden in othrys.rules, which blocks them under every mode. permissions.extraRules appends lines in Codex’s rule syntax. An allow rule runs its command outside the sandbox, so the only allow rules the modules write are the read-only gh commands, which need the network the sandbox withholds. Codex appends the commands a user chooses to always allow to default.rules, which the modules leave alone.
  • Commit attribution. Codex adds a Co-authored-by: Codex trailer when the ChatGPT account’s commit attribution setting is on. That setting lives on OpenAI’s servers, and no config.toml key turns it off, so turn it off in the account’s Codex settings. An instruction in AGENTS.md does not override it.

The sign-in goes to the desktop keyring where one answers and to ~/.codex/auth.json otherwise. config.toml is merged at each activation rather than linked read-only, since Codex records trusted directories there itself. Under impermanence the module persists ~/.codex at mode 0700, which holds the sign-in file, the sessions, the history and the state database.

Claude Desktop

othrys.apps.ai.claude-desktop installs Anthropic’s desktop app for the user, repackaged from Anthropic’s own Linux build. It needs a graphical session and refuses a host without one. Cowork’s virtual machines need qemu and KVM from the host, which the module does not provide.

The app reads local MCP servers, the ones with a command, from ~/.config/Claude/claude_desktop_config.json. It keeps its preferences in the same file, so the file stays writable, and each activation sets its mcpServers key to the local servers under programs.mcp.servers. Remote servers such as Context7 are added in the app’s own settings. With no local server declared, the file is left as the app keeps it, so removing the last local server leaves the entries the previous activation wrote, to be removed in the app or by hand. The app reads the file at launch, so a running app picks up a change after a restart.

Under impermanence the module persists ~/.config/Claude at mode 0700, which holds the app’s profile, its logs and the config file. The sign-in sits in the desktop keyring.

Orca

By default, Orca starts Claude Code with --dangerously-skip-permissions and Codex with --dangerously-bypass-approvals-and-sandbox. Every permission prompt is then gone for the sessions it starts, Claude Code’s deny list no longer applies, and Codex runs outside its sandbox. The setting lives in Orca’s own state, which no module can declare, so turn it off once per user in Settings → Agents → Agent Permissions → Manual. The choice persists with the rest of Orca’s state.

othrys.apps.ai.orca installs Orca for the user and needs a graphical session. Each task runs in its own git worktree under ~/orca/workspaces. Orca finds Claude Code, Codex and the other agents on the login shell’s PATH and bundles none of them. It writes status hooks into Claude Code’s and Codex’s settings, which is why both keep their settings writable.

disableTelemetry, on by default, wraps the package so that Orca starts with ORCA_TELEMETRY_DISABLED set, since a new install otherwise reports usage to PostHog. Orca still shows a notice when a newer release exists and downloads nothing.

Orca’s runtime port, 6768 by default, binds to loopback until network pairing is turned on in the app. The module opens it on no interface by default. othrys.apps.ai.orca.tailscale.enable opens it on Tailscale’s interface alone, and refuses a host without othrys Tailscale. A client then passes the tailnet’s ACLs and Orca’s per-client pairing token, and the tailnet’s ACL policy should limit that port to the user’s own devices. The port is never opened on the LAN, and Orca’s own documentation advises against exposing it.

Under impermanence the module persists ~/.config/orca, ~/.orca and ~/orca/workspaces, each at mode 0700. They hold the profiles and the permission setting above, the API key files, and the worktrees with the agents’ uncommitted work.

T3 Code

othrys.apps.ai.t3code installs T3 Code, a web and desktop interface that runs coding agents in threads. It installs t3 for the user in both modes. The agents it drives are the host’s own Codex and Claude Code packages, each one while its module is on, and the module refuses a host with neither. Upstream’s default package instead bundles five agents ahead of the user’s PATH, three of them unfree.

mode has no default, and a host that leaves it unset is refused. With "headless" the module runs t3 serve as a systemd user unit on NixOS and as a launchd agent on nix-darwin, restarted whenever it exits. On a NixOS host where othrys manages the user with Home Manager, the user lingers, so the unit runs from boot with nobody logged in. A launchd agent runs only while the user is logged in, so a Mac that serves T3 Code logs the user in at boot. With "desktop" it installs the desktop app, which starts its own server while a window is open, and it refuses a host without a graphical session. Only one server can use ~/.t3. A second one finds the first one’s lock in ~/.t3/userdata/server-owner.sqlite and exits, and the desktop app then quits with “This T3 home is unavailable”. A workstation in desktop mode reaches a headless host by adding it in the app as a saved environment.

# A headless host on the tailnet
othrys.services.tailscale.enable = true;
othrys.apps.ai.codex.enable = true;
othrys.apps.ai.t3code = {
  enable = true;
  mode = "headless";
  listen = "tailscale";
};

# A workstation
othrys.apps.ai.claude-code.enable = true;
othrys.apps.ai.t3code = {
  enable = true;
  mode = "desktop";
};

listen applies to the headless server alone, and desktop mode refuses any value but "loopback". "lan" passes upstream’s --lan, which binds every address and drops a peer outside loopback, the private ranges and the tailnet. On NixOS it opens port in the firewall. othrys controls no firewall on macOS, so there the peer filter and pairing are what protect the port. "tailscale" binds the tailnet IPv4 address that tailscale ip -4 gives when the server starts. With no address the server exits, and the service starts it again ten seconds later until tailscaled has one. On NixOS it opens port on Tailscale’s interface alone, and it refuses a host without othrys.services.tailscale.enable. Traffic is plain HTTP inside WireGuard. Upstream’s --tailscale-serve is not used, since its HTTPS needs node certificates from the control server, which headscale 0.29 does not issue.

Every mode but loopback asks a new client to pair. The server writes a pairing link at start, valid for five minutes, to the journal on NixOS and to ~/Library/Logs/t3code.log on darwin. t3 pair mints a new one later.

$ journalctl --user -u t3code
$ t3 pair

disableTelemetry, on by default, starts t3 and the desktop app with T3CODE_TELEMETRY_ENABLED=false. The desktop app also always starts with T3CODE_DISABLE_AUTO_UPDATE=1, since an app in the store cannot replace itself.

Under impermanence the module persists ~/.t3 at mode 0700, which holds the threads database, the server’s secrets, the settings and the git worktrees with the agents’ uncommitted work. Desktop mode also persists the Electron profile in ~/.config/t3code-v2 at 0700. ~/.cache/t3code is a compile cache and is not persisted. The agents’ sign-ins live in ~/.codex and ~/.claude, which their own modules persist.

Options

  options.othrys.apps.ai.t3code = {
    enable = lib.mkEnableOption "T3 Code, a control surface for coding agents";

    package = lib.mkOption {
      type = lib.types.package;
      default = (llmAgents.package "t3code").override {providerPackages = providers;};
      defaultText = lib.literalMD ''
        the `t3code` package of the llm-agents flake this library locks, with
        the packages of `othrys.apps.ai.codex` and `othrys.apps.ai.claude-code`
        as its agents, each one while its module is on
      '';
      description = ''
        The T3 Code package, whose `out` output holds the `t3` server and
        whose `desktop` output holds the desktop app. The default comes from
        cache.numtide.com, which the host then trusts. Upstream's own default
        puts five agents ahead of the user's PATH, three of them unfree. A
        package set here is used as given.
      '';
    };

    mode = lib.mkOption {
      type = lib.types.nullOr (lib.types.enum ["headless" "desktop"]);
      default = null;
      description = ''
        `"headless"` installs `t3` and runs `t3 serve` as a user service, a
        systemd unit on NixOS and a launchd agent on darwin. `"desktop"`
        installs the desktop app, which starts its own server while a window
        is open, beside `t3`. The two cannot share one `~/.t3`, since the
        second server finds the first one's lock and exits, so a host picks
        one.
      '';
    };

    listen = lib.mkOption {
      type = lib.types.enum ["loopback" "lan" "tailscale"];
      default = "loopback";
      description = ''
        Where the headless server listens. `"loopback"` keeps it to this
        host. `"lan"` binds every address and drops any peer outside
        loopback, the private ranges and the tailnet, and on NixOS opens
        `port` in the firewall. `"tailscale"` binds the host's tailnet
        address alone and on NixOS opens `port` on Tailscale's interface.
        Every mode but loopback asks a new client to pair, with a link from
        `t3 pair`.
      '';
    };

    port = lib.mkOption {
      type = lib.types.port;
      default = 3773;
      description = "Port the headless server listens on, which is upstream's own default.";
    };

    disableTelemetry = lib.mkOption {
      type = lib.types.bool;
      default = true;
      description = ''
        Start `t3` and the desktop app with `T3CODE_TELEMETRY_ENABLED` set
        to false, which turns off the product events T3 Code sends.
      '';
    };
  };

Paseo

othrys.apps.ai.paseo installs Paseo’s paseo CLI for the user, and desktop.enable adds its desktop app. On darwin, Home Manager links Paseo.app into ~/Applications/Home Manager Apps, not /Applications. nixpkgs’ build turns the app’s self-update off, since a store path cannot change. The agents it drives are the host’s own Codex and Claude Code, which it finds on the daemon’s PATH as the launchers of the project environment, each one while its module is on. The module refuses a host with neither. T3 Code and Paseo can be enabled on one host, and they share no state or port.

Without service.enable the module runs no daemon. The desktop app then starts a daemon of its own, which reads none of the module’s daemon options, so the module refuses listen, relay.enable, passwordFile and direnv.enable without the service. With service.enable the daemon runs as a systemd user unit on NixOS, restarted ten seconds after it exits, and as a launchd agent on nix-darwin, started again no sooner than ten seconds after its last start. The desktop app attaches to it. On a NixOS host where othrys manages the user with Home Manager, the user lingers, so the unit runs from boot with nobody logged in. The launchd agent runs while the user is logged in. The service runs paseo-server directly, since paseo daemon start drops every PASEO_* variable the module sets. The log is in the journal on NixOS and in ~/Library/Logs/paseo.log on darwin.

othrys.services.tailscale.enable = true;
othrys.apps.ai.codex.enable = true;
othrys.apps.ai.paseo = {
  enable = true;
  service.enable = true;
  listen = "tailscale";
  passwordFile = "/run/secrets/paseo-password";
};

"lan" binds every address and on NixOS opens port in the firewall. "tailscale" binds the tailnet IPv4 address and admits the host’s MagicDNS name, read when the daemon starts. With no address the daemon exits and the service starts it again until tailscaled has one. On NixOS it opens port on Tailscale’s interface alone, and it refuses a host without othrys.services.tailscale.enable. othrys controls no firewall on macOS. Outside loopback, any peer that reaches the port controls the host’s agents unless the daemon has a password, and the module warns while passwordFile is unset. A password set with paseo daemon set-password also counts, while passwordFile wins over it. A password file the daemon cannot read stops it.

The hosted relay at relay.paseo.sh stays off unless relay.enable is set. The setting is passed as PASEO_RELAY_ENABLED at every start, so a config.json that omits it does not turn the relay on.

webUi.enable makes the daemon serve Paseo’s browser UI on its own port, beside the API and the WebSocket, and the setting is passed as PASEO_WEB_UI_ENABLED at every start, so config.json cannot turn it on. The page loads without the password, while the API behind it asks for one. The daemon refuses a request whose Host header is neither one of its addresses nor a listed name, which guards against DNS rebinding, so a reverse proxy’s name goes in hostnames. The proxy must pass the Host header through unchanged and forward the WebSocket upgrade at /ws.

othrys.apps.ai.paseo = {
  enable = true;
  service.enable = true;
  listen = "tailscale";
  webUi.enable = true;
  hostnames = ["paseo.example.com"];
  passwordFile = "/run/secrets/paseo-password";
};

direnv.enable defaults to on while the service and othrys.apps.ai.projectEnvironment.enable are both on. It loads the paseo-direnv plugin, which loads the direnv environment of each agent’s directory before the agent starts. It is on by default because it is the project environment’s counterpart inside Paseo. Without it, a Codex agent the daemon starts misses the environment that the launcher gives the same agent started from a shell. The plugin runs unsandboxed with the user’s access, so a host that does not want it sets direnv.enable = false. That covers Codex agents, whose process Paseo starts with no working directory, and the app offers to allow or deny a blocked .envrc. The plugin comes from its own flake input, which only a host with the option on fetches. Paseo enables plugins only through ~/.paseo/config.json, so the start script sets pluginsEnabled and the plugin’s own entry there at every start. While the option is off, each Home Manager switch and each start remove an entry that points into the store, which an earlier generation wrote, so a daemon othrys does not start, such as the desktop app’s own, loads no collected store path. An entry pointed at a checkout of the user’s own stays. The file is rewritten only when the entry changes, and nothing else in it is touched. A config.json that jq cannot read, an empty one included, stops the daemon and is left as it is. Turning othrys.apps.ai.paseo.enable off removes nothing, so delete the paseo-direnv entry by hand if Paseo still runs outside othrys. A new worktree inherits trust as othrys.apps.ai.projectEnvironment.trustWorktrees says, passed as PASEO_DIRENV_TRUST_WORKTREES. The variable wins over the plugin’s toggle under Settings → Plugins → direnv → Worktrees, which shows the value disabled.

Under impermanence the module persists ~/.paseo at mode 0700, which holds config.json with the password hash, the daemon’s key pair, the plugins’ settings, the agents’ state and the git worktrees with their uncommitted work. With desktop.enable it also persists the app’s profile in ~/.config/Paseo at 0700.

Options

  options.othrys.apps.ai.paseo = {
    enable = lib.mkEnableOption "Paseo, a self-hosted daemon and CLI for orchestrating coding agents";

    package = lib.mkOption {
      type = lib.types.package;
      default = pkgs.paseo;
      defaultText = lib.literalExpression "pkgs.paseo";
      description = ''
        The Paseo package, which holds the `paseo` CLI, the `paseo-server`
        daemon and the web UI the daemon serves.
      '';
    };

    service.enable = lib.mkEnableOption ''
      the Paseo daemon as a user service, a systemd unit on NixOS and a
      launchd agent on darwin. The desktop app attaches to this daemon
      instead of starting its own'';

    desktop = {
      enable = lib.mkEnableOption ''
        the Paseo desktop app. Without `service.enable` the app
        starts a daemon of its own, which reads none of the options below'';

      package = lib.mkOption {
        type = lib.types.package;
        default = pkgs.paseo.desktop;
        defaultText = lib.literalExpression "pkgs.paseo.desktop";
        description = ''
          The Paseo desktop package, which holds `Paseo.app` on darwin.
        '';
      };
    };

    listen = lib.mkOption {
      type = lib.types.enum ["loopback" "lan" "tailscale"];
      default = "loopback";
      description = ''
        Where the daemon listens. `"loopback"` keeps it to this host. `"lan"`
        binds every address and on NixOS opens `port` in the firewall.
        `"tailscale"` binds the host's tailnet address alone, admits the
        host's MagicDNS name in the Host header and on NixOS opens `port` on
        Tailscale's interface. Every peer that reaches the port can connect
        unless `passwordFile` is set.
      '';
    };

    port = lib.mkOption {
      type = lib.types.port;
      default = 6767;
      description = "Port the daemon listens on, which is upstream's own default.";
    };

    relay.enable = lib.mkEnableOption ''
      the hosted relay at relay.paseo.sh, through which a client outside the
      network reaches the daemon. The daemon then keeps an outbound
      connection to that server, and the traffic over it is end-to-end
      encrypted'';

    webUi.enable = lib.mkEnableOption ''
      the browser UI the daemon serves on its own port, beside its API and
      WebSocket. The page itself loads without the password, while the API
      behind it asks for one'';

    hostnames = lib.mkOption {
      type = lib.types.listOf lib.types.str;
      default = [];
      example = ["paseo.example.com"];
      description = ''
        Hostnames the daemon accepts in the Host header besides its own
        addresses, such as the name a reverse proxy serves it under. The
        daemon refuses any other name, which guards against DNS rebinding.
        `"tailscale"` adds the host's MagicDNS name on its own.
      '';
    };

    passwordFile = lib.mkOption {
      type = lib.types.nullOr lib.types.str;
      default = null;
      example = "/run/secrets/paseo-password";
      description = ''
        A file holding the daemon's password, read when the daemon starts, so
        the password stays out of the store. It takes precedence over a hash
        that `paseo daemon set-password` wrote to `~/.paseo/config.json`.
      '';
    };

    direnv = {
      enable = lib.mkOption {
        type = lib.types.bool;
        default = cfg.service.enable && envCfg.enable;
        defaultText = lib.literalExpression "othrys.apps.ai.paseo.service.enable && othrys.apps.ai.projectEnvironment.enable";
        description = ''
          The paseo-direnv plugin in the daemon othrys runs. It loads the
          direnv environment of each agent's directory before the agent
          starts, and offers to allow a blocked `.envrc` in the app. A new
          git worktree inherits trust as
          othrys.apps.ai.projectEnvironment.trustWorktrees says, and the
          plugin's own toggle shows that value disabled.
        '';
      };

      package = lib.mkOption {
        type = lib.types.package;
        default = othrysInputs.paseo-direnv.packages.${pkgs.stdenv.hostPlatform.system}.default;
        defaultText = lib.literalMD "the default package of the paseo-direnv flake this library locks";
        description = ''
          The paseo-direnv plugin, a directory holding its manifest and its
          TypeScript source, which Paseo compiles when it loads it.
        '';
      };
    };
  };

Claude Code’s settings file

Claude Code’s settings.json is merged at each activation rather than linked read-only. The declared settings win, while keys that Claude Code or a program it runs adds itself stay in place, such as the status hooks Orca writes. A host that wants the file read-only sets home-manager.users.<name>.programs.claude-code.mutableSettings = false.

What the Claude Code permission lists are for

othrys.apps.ai.claude-code ships an allow-list and a deny-list, and it is worth being plain about what they do. They reduce prompting for commands you would approve anyway, and they catch a careless mistake. They are not a security boundary.

A rule matches a command string, and a string has endless spellings. rm -rf is denied while rm -fr is not. sudo is denied while pkexec is not. Read(./.env) is denied while cat .env arrives as a Bash invocation and matches nothing. Anything that can run a shell can reach whatever the user can reach, so the boundary that actually holds is whether the repository is one you trust.

Three defaults follow from that. Every allow-list entry names a tool and a command prefix, and no bare tool name appears, since a bare Edit approves every edit and is acceptEdits by another route. Bash(just:*), Bash(find:*), Bash(nix eval:*) and Bash(nix fmt:*) are absent, because each one runs whatever a repository hands it, through a recipe, -exec, --expr or the repository’s own formatter. And permissions.defaultMode is "default", so edits are prompted rather than applied. Hosts that want any of them back set permissions.extraAllow and permissions.defaultMode explicitly, which keeps the decision visible in the host configuration rather than inherited from a library. The module registers no hooks of its own.

theme takes one of Claude Code’s six themes, dark, light, dark-daltonized, light-daltonized, dark-ansi and light-ansi. Any other value is refused at evaluation.

Shared skills and context

Two things are declared once and handed to every enabled assistant.

othrys.apps.ai.skills holds skills in the Agent Skills layout, keyed by name. A value is the text of a SKILL.md, the path of one, or the path of a directory that holds one. A name is lower-case letters, digits and single hyphens, and any other name is refused at evaluation. A skill for one tool alone goes to that tool’s own option, such as othrys.apps.ai.claude-code.skills, and an entry there replaces a shared one of the same name.

othrys.apps.ai.skills.release-notes = ./skills/release-notes;

othrys.apps.ai.context is the global context. Its first part describes the host the assistant runs on, and context.nixos.enable = false leaves it out. It defaults to off on darwin, where the text about NixOS does not apply. The line about the root wipe is rendered from othrys.system.impermanence.enable, so a host with a persistent root is not told its root is wiped. The line about where to store data follows the same option. It says “only in $HOME” on a host that wipes its root and suggests the home directory on every other host. context.extra holds the host’s own lines, which follow that text. context.text is the rendered result.

othrys.apps.ai.mcp.context is a removed option, and its text is othrys.apps.ai.context.text.

Ollama

othrys.apps.ai.ollama runs the Ollama server on the address in host and the port in port, 127.0.0.1 and 11434 by default. It pulls the models in loadModels at start and persists them. acceleration picks the package, and its default follows the host. An othrys.hardware.nvidia host gets ollama-cuda, any other host with hardware.graphics.enable gets ollama-vulkan, which runs on AMD and Intel cards, and a host without graphics gets ollama-cpu. An AMD host that wants ROCm sets acceleration = "rocm". The CUDA build is unfree and pulls the CUDA toolkit, so a host without an NVIDIA card never gets it by default.

host = "0.0.0.0" or host = "::" serves every address. Ollama asks for no credentials, so anything that reaches the port can run models. On NixOS the module opens no port in the firewall, so while networking.firewall.enable is on the host opens it where it wants clients, for example with networking.firewall.interfaces.<name>.allowedTCPPorts. On nix-darwin nothing closes the port, so an address other than loopback is reachable from the network as soon as the agent starts.

othrys.apps.ai.ollama = {
  enable = true;
  host = "0.0.0.0";
};
networking.firewall.interfaces.eth0.allowedTCPPorts = [11434];

The module sets OLLAMA_HOST for the user, so the ollama client finds the server. When the server binds every address, the variable points at the loopback of that family, 127.0.0.1 for 0.0.0.0 and [::1] for ::, and otherwise at the address the server binds. An IPv6 address is put in brackets for the server and the client alike, since both upstream modules join the host and the port with a bare colon. The module hands the server both values as defaults, and the variable is read from the server’s merged values, so a host that sets services.ollama.host or services.ollama.port itself still points the client at the server.

On nix-darwin, which has no Ollama service, the server is Home Manager’s services.ollama. It runs as the user’s launchd agent on the same host and port and reaches the user through darwinModules.home, so a host without a managed account gets no server. The CUDA, ROCm and Vulkan variants are Linux only, so acceleration defaults to "cpu" there, which names nixpkgs’ one darwin build, and any other value is refused. Home Manager’s agent pulls no models, so loadModels is refused as well, and the user runs ollama pull.

MCP Servers

Model Context Protocol servers provide AI assistants with live tool access. othrys.apps.ai.mcp.context7 serves up-to-date library documentation and code examples, and takes no credential.

The NixOS MCP server is gone. It depended on fastmcp, which nixpkgs marked broken, and the nix CLI answers the same questions. nix search nixpkgs finds packages, and man configuration.nix and man home-configuration.nix list the options. A host that still sets othrys.apps.ai.mcp.nixos fails evaluation with that advice.

GitHub

There is no GitHub MCP server. An agent reaches GitHub through the gh CLI, which acts with the user’s own login, so no separate long-lived token is kept for the agent. othrys.apps.gh configures it, and on a host that also enables Claude Code it adds the read-only gh commands to the allow-list. Reading an issue, a pull request, a workflow run or a release then runs without a prompt, while every command that writes to GitHub is prompted.

othrys.apps.ai.mcp.github is a removed option, and a host that still sets it fails at evaluation with a message naming othrys.apps.gh.