homeserver: disable auto login and zellij only attach on ssh connection

This commit is contained in:
Tigor Hutasuhut 2024-09-05 11:44:20 +07:00
parent b566cdb15c
commit 0f56e29da7
2 changed files with 22 additions and 18 deletions

View file

@ -27,6 +27,7 @@ in
if cfg.autoAttach then
/*bash*/
''
if [[ ! -z "$SSH_CLIENT" ]]; then
if [[ -z "$ZELLIJ" ]]; then
ZJ_SESSIONS=$(zellij list-sessions --no-formatting)
NO_SESSIONS=$(echo "$ZJ_SESSIONS" | wc -l)
@ -42,13 +43,16 @@ in
fi
exit
fi
fi
''
else
/*bash*/ ''
if [[ ! -z "$SSH_CLIENT" ]]; then
if [[ -z "$ZELLIJ" ]]; then
zellij attach -c default
exit
fi
fi
''
);

View file

@ -11,7 +11,7 @@
user = {
name = "homeserver";
fullName = "Homeserver";
getty.autoLogin = true;
getty.autoLogin = false;
};
system.stateVersion = "24.05";