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
Showing only changes of commit 40ed4c101f - Show all commits
+17 -4
View File
@@ -15,7 +15,19 @@ in {
host = mkOption { host = mkOption {
type = types.str; type = types.str;
default = "m3-hermes"; default = "m3-hermes";
description = "SSH hostname (must match a matchBlocks entry)."; 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 { session = mkOption {
@@ -28,9 +40,10 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ home.packages = [
(pkgs.writeShellScriptBin "hermes-remote" '' (pkgs.writeShellScriptBin "hermes-remote" ''
# hermes-remote SSH into m3-hermes and attach/create a Zellij session with hermes CLI. # hermes-remote SSH into m3-hermes as the hermes user and
# Uses -t for PTY allocation (required by both Zellij and Hermes). # attach/create a Zellij session with the Hermes CLI.
exec ssh -t ${cfg.host} "zellij attach -c ${cfg.session} || zellij -s ${cfg.session}" exec ssh -t -i ${cfg.identityFile} ${cfg.user}@${cfg.host} \
"zellij attach -c ${cfg.session} || zellij -s ${cfg.session}"
'') '')
]; ];
}; };