Skip to content

Commit b1526ba

Browse files
committed
refactor(ssh): avoid alias merge fold
Generate SSH shell aliases with listToAttrs so evaluation does not repeatedly merge a growing alias set.
1 parent 571dd72 commit b1526ba

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

modules/common/programs/terminal/tools/ssh/default.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ in
145145

146146
khanelinix = {
147147
home.extraOptions = {
148-
home.shellAliases = lib.foldl (
149-
aliases: system: aliases // { "ssh-${system}" = "ssh ${system} -t tmux a"; }
150-
) { } (builtins.attrNames other-hosts);
148+
home.shellAliases = builtins.listToAttrs (
149+
map (system: {
150+
name = "ssh-${system}";
151+
value = "ssh ${system} -t tmux a";
152+
}) (builtins.attrNames other-hosts)
153+
);
151154
};
152155
};
153156

0 commit comments

Comments
 (0)