summaryrefslogtreecommitdiffstats
path: root/configs/hermes.nix
diff options
context:
space:
mode:
Diffstat (limited to 'configs/hermes.nix')
-rw-r--r--configs/hermes.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix
index 5ff49d9..c1a6cb6 100644
--- a/configs/hermes.nix
+++ b/configs/hermes.nix
@@ -5,6 +5,10 @@
{ config, lib, pkgs, ... }:
let
tmux = "${pkgs.tmux}/bin/tmux -S /run/hermes/tmux";
+ # Root's way (back) into hermes' tmux.
+ hermes-attach = pkgs.writeShellScriptBin "hermes-attach" ''
+ exec ${tmux} attach -t hermes
+ '';
# Bump url and sha256 together.
src = builtins.fetchTarball {
@@ -108,9 +112,10 @@ in
};
inherit (config.systemd.services.hermes-agent) path;
};
- # Detaching gets root's shell back.
+ # 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 ${tmux} attach -t hermes; fi
+ if [ "$USER" = root ] && [ -z "$TMUX" ]; then ${lib.getExe hermes-attach}; fi
'';
# The module adds pkgs.git, which needs perl; the package has gitMinimal.