diff options
Diffstat (limited to 'configs')
| -rw-r--r-- | configs/claude.nix | 4 | ||||
| -rw-r--r-- | configs/hermes.nix | 17 |
2 files changed, 16 insertions, 5 deletions
diff --git a/configs/claude.nix b/configs/claude.nix index db74ce7..f29ea2f 100644 --- a/configs/claude.nix +++ b/configs/claude.nix @@ -4,7 +4,7 @@ # Once, as root: runuser -l claude -c 'claude auth login', then # claude-attach and answer Remote Control's questions there (enable it, # trust ~/src). The state is in /home/claude, i.e. on the run script's -# --home drive. +# --home drive, which is required. { config, lib, pkgs, ... }: let tmux = "${pkgs.tmux}/bin/tmux -S /run/claude/tmux"; @@ -33,6 +33,8 @@ in { nixpkgs.config.allowUnfreePredicate = pkg: lib.getName pkg == "claude-code"; + fc.home.required = true; + users.users.claude = { isNormalUser = true; home = "/home/claude"; diff --git a/configs/hermes.nix b/configs/hermes.nix index b3b66be..3cf726a 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -4,7 +4,9 @@ # model: the Claude API (provider anthropic, the default), with the API key # from the host's xchg (see environmentFiles), and the Claude subscription # through the claude CLI (provider claude-subscription-directsdk-experimental): -# log in once with claude auth login, in a new window there (C-b c). +# log in once with claude auth login, in a new window there (C-b c). The +# state is in /home/hermes, i.e. on the run script's --home drive, which is +# required. { config, lib, pkgs, hostPkgs, ... }: let tmux = "${pkgs.tmux}/bin/tmux -S /run/hermes/tmux"; @@ -115,9 +117,8 @@ in git = pkgs.gitMinimal; wl-clipboard = pkgs.emptyDirectory; }; - # /var is a tmpfs. This is on the only drive that can outlive a boot, - # like nix's database, see /nix/var. - stateDir = "/nix/.rw-store/hermes"; + # hermes' home, as the module makes it, on the --home drive. + stateDir = "/home/hermes"; # The anthropic provider uses ANTHROPIC_API_KEY from hermes.env, see below. # Don't put ANTHROPIC_TOKEN or CLAUDE_CODE_OAUTH_TOKEN otherwise hermes # disguises itself as claude code. @@ -150,6 +151,14 @@ in ]; nixpkgs.config.allowUnfreePredicate = pkg: lib.getName pkg == "claude-code"; + fc.home.required = true; + # /home is mounted after users get created; the module's tmpfiles create + # the home instead. + users.users.hermes.createHome = lib.mkForce false; + systemd.services.hermes-agent-setup.unitConfig.RequiresMountsFor = config.services.hermes-agent.stateDir; + systemd.services.hermes-agent.unitConfig.RequiresMountsFor = config.services.hermes-agent.stateDir; + systemd.services.hermes-tmux.unitConfig.RequiresMountsFor = config.services.hermes-agent.stateDir; + # hermes' home is stateDir, so this uses the service's state at ~/.hermes. # tmux lets root attach to it. Socket-activated: the first client # starts the server, whose config starts hermes, and quitting hermes |
