From f284a60c9d6efedf659bcc940dc0daf119b54944 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 17:13:49 +0000 Subject: configs/hermes: don't attach root's login shell to hermes' tmux Root's login shell ran hermes-attach, which starts hermes' tmux, and root logs in automatically on the console. Root attaches with hermes-attach when it wants to. --- configs/hermes.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'configs/hermes.nix') diff --git a/configs/hermes.nix b/configs/hermes.nix index 93dbfbf..6000e06 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -1,7 +1,7 @@ # Hermes Agent (Nous Research), with its own NixOS module, fitted to this -# guest. hermes runs as hermes in a tmux, which root's console opens. It -# uses the Claude subscription through the claude CLI: log in once with -# claude auth login, in a new window there (C-b c). +# guest. hermes runs as hermes in a tmux, which root opens with +# hermes-attach. It uses the Claude subscription through the claude CLI: +# log in once with claude auth login, in a new window there (C-b c). { config, lib, pkgs, hostPkgs, ... }: let tmux = "${pkgs.tmux}/bin/tmux -S /run/hermes/tmux"; @@ -31,7 +31,7 @@ let ''; }); - # Root's way (back) into hermes' tmux. + # Root's way into hermes' tmux; attaching starts it (see hermes-tmux). hermes-attach = pkgs.writeShellScriptBin "hermes-attach" '' exec ${tmux} attach -t hermes ''; @@ -162,11 +162,7 @@ in }; inherit (config.systemd.services.hermes-agent) path; }; - # Detaching gets root's shell back, and hermes-attach goes back in. environment.systemPackages = [ hermes-attach ]; - programs.bash.loginShellInit = '' - if [ "$USER" = root ] && [ -z "$TMUX" ]; then ${lib.getExe hermes-attach}; fi - ''; # The module adds pkgs.git, which needs perl; the package has gitMinimal. systemd.services.hermes-agent.path = lib.mkForce ([ -- cgit v1.3.1