feat: add hermes-remote CLI shortcut (SSH + Zellij to m3-hermes)

This commit is contained in:
2026-05-11 18:23:26 +02:00
parent 9f35dfb253
commit 2a3d784938
2 changed files with 38 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@
./direnv.nix ./direnv.nix
./eza.nix ./eza.nix
./fzf.nix ./fzf.nix
./hermes-remote.nix
./lf.nix ./lf.nix
./nitch.nix ./nitch.nix
./packages.nix ./packages.nix
+37
View File
@@ -0,0 +1,37 @@
# hermes-remote — SSH into m3-hermes and attach/create a Zellij session running the Hermes CLI.
# Available on all hosts (base profile), uses the m3-hermes SSH match block.
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.base.cliTools.hermesRemote;
in {
options.base.cliTools.hermesRemote = {
enable = (mkEnableOption "enable hermes-remote shortcut") // {default = true;};
host = mkOption {
type = types.str;
default = "m3-hermes";
description = "SSH hostname (must match a matchBlocks entry).";
};
session = mkOption {
type = types.str;
default = "hermes";
description = "Zellij session name on the remote host.";
};
};
config = mkIf cfg.enable {
home.packages = [
(pkgs.writeShellScriptBin "hermes-remote" ''
# hermes-remote SSH into m3-hermes and attach/create a Zellij session with hermes CLI.
# Uses -t for PTY allocation (required by both Zellij and Hermes).
exec ssh -t ${cfg.host} "zellij attach -c ${cfg.session} || zellij -s ${cfg.session}"
'')
];
};
}