mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-06 21:05:08 +02:00
feat: disable zellij auto exit
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
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
|
||||||
|
$env.ZELLIJ_AUTO_EXIT = "false" # disable auto 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;
|
||||||
|
}
|
||||||
@@ -6,27 +6,7 @@ in {
|
|||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
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
|
|
||||||
$env.ZELLIJ_AUTO_EXIT = "true" # enable auto exit
|
|
||||||
if "ZELLIJ_AUTO_EXIT" in $env and $env.ZELLIJ_AUTO_EXIT == "true" {
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# only works in bash/zsh, not nushell
|
# only works in bash/zsh, not nushell
|
||||||
home.shellAliases = shellAliases;
|
home.shellAliases = shellAliases;
|
||||||
programs.nushell.shellAliases = shellAliases;
|
programs.nushell.shellAliases = shellAliases;
|
||||||
|
|
||||||
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user