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

Merged
m3tam3re merged 2 commits from feat/hermes-remote into master 2026-05-11 18:29:01 +02:00
2 changed files with 51 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@
./direnv.nix
./eza.nix
./fzf.nix
./hermes-remote.nix
./lf.nix
./nitch.nix
./packages.nix
+50
View File
@@ -0,0 +1,50 @@
# 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 (resolved via ~/.ssh/config matchBlocks).";
};
user = mkOption {
type = types.str;
default = "hermes";
description = "Remote SSH user.";
};
identityFile = mkOption {
type = types.str;
default = "~/.ssh/hermes";
description = "SSH private key for the hermes user.";
};
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 as the hermes user and
# attach/create a Zellij session with the Hermes CLI.
exec ssh -t -i ${cfg.identityFile} ${cfg.user}@${cfg.host} \
"zellij attach -c ${cfg.session} || zellij -s ${cfg.session}"
'')
];
};
}