Files
nix-config/home/base/server/zellij/default.nix
Ryan Yin 137e11e81f feat: shortname of zellij
feat: autostart zellij in nushell
2023-12-27 19:29:48 +08:00

32 lines
713 B
Nix

let
shellAliases = {
"zj" = "zellij";
};
in {
programs.zellij = {
enable = true;
};
# auto start zellij in nushell
programs.nushell.extraConfig = ''
# auto start zellij
if not "ZELLIJ" in $env {
if "ZELLIJ_AUTO_ATTACH" in $env and $env.ZELLIJ_AUTO_ATTACH == "true" {
zellij attach -c
} else {
zellij
}
# auto exit the shell session when zellij exit
if "ZELLIJ_AUTO_EXIT" in $env and $env.ZELLIJ_AUTO_EXIT == "true" {
exit
}
}
'';
# only works in bash/zsh, not nushell
home.shellAliases = shellAliases;
programs.nushell.shellAliases = shellAliases;
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
}