Merge 716961c53c
into 6d3b6dc922
This commit is contained in:
commit
e76f48848b
|
@ -485,6 +485,12 @@
|
|||
keys =
|
||||
[{ fingerprint = "75F0 AB7C FE01 D077 AEE6 CAFD 353E 4A18 EE0F AB72"; }];
|
||||
};
|
||||
tennox = {
|
||||
name = "Manu";
|
||||
github = "tennox";
|
||||
githubId = 2084639;
|
||||
matrix = "@tennox:matrix.org";
|
||||
};
|
||||
tensor5 = {
|
||||
github = "tensor5";
|
||||
githubId = 1545895;
|
||||
|
|
|
@ -9,7 +9,7 @@ let
|
|||
zellijCmd = getExe cfg.package;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.mainrs ];
|
||||
meta.maintainers = with hm.maintainers; [ mainrs tennox ];
|
||||
|
||||
options.programs.zellij = {
|
||||
enable = mkEnableOption "zellij";
|
||||
|
@ -49,9 +49,28 @@ in {
|
|||
default = false;
|
||||
};
|
||||
|
||||
enableFishIntegration = mkEnableOption "Fish integration" // {
|
||||
enableFishIntegration = mkEnableOption
|
||||
"Fish integration (enables both enableFishAutoStart and enableFishCompletions)"
|
||||
// {
|
||||
default = false;
|
||||
};
|
||||
enableFishCompletions = mkEnableOption "load zellij completions" // {
|
||||
default = false;
|
||||
};
|
||||
enableFishAutoStart =
|
||||
mkEnableOption "autostart zellij in interactive sessions" // {
|
||||
default = false;
|
||||
};
|
||||
autoStartAttachIfSessionExists = mkEnableOption
|
||||
"If the zellij session already exists, attach to the default session. (requires enableFishAutoStart)"
|
||||
// {
|
||||
default = false;
|
||||
};
|
||||
autoStartExitShellOnZellijExit = mkEnableOption
|
||||
"When zellij exits, exit the shell as well. (requires enableFishAutoStart)"
|
||||
// {
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -77,9 +96,22 @@ in {
|
|||
eval "$(${zellijCmd} setup --generate-auto-start zsh)"
|
||||
'');
|
||||
|
||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration
|
||||
(mkOrder 200 ''
|
||||
eval (${zellijCmd} setup --generate-auto-start fish | string collect)
|
||||
'');
|
||||
home.sessionVariables = {
|
||||
ZELLIJ_AUTO_ATTACH =
|
||||
if cfg.autoStartAttachIfSessionExists then "true" else "false";
|
||||
ZELLIJ_AUTO_EXIT =
|
||||
if cfg.autoStartExitShellOnZellijExit then "true" else "false";
|
||||
};
|
||||
|
||||
programs.fish.interactiveShellInit = mkIf (cfg.enableFishIntegration
|
||||
|| cfg.enableFishAutoStart || cfg.enableFishCompletions) (mkOrder 200
|
||||
((if cfg.enableFishIntegration || cfg.enableFishCompletions then ''
|
||||
eval (${zellijCmd} setup --generate-completion fish | string collect)
|
||||
'' else
|
||||
"") + (if cfg.enableFishIntegration || cfg.enableFishAutoStart then ''
|
||||
eval (${zellijCmd} setup --generate-auto-start fish | string collect)
|
||||
'' else
|
||||
"")));
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
enableFishIntegration = true;
|
||||
enableFishAutoStart = true;
|
||||
enableFishCompletions = true;
|
||||
autoStartAttachIfSessionExists = true;
|
||||
autoStartExitShellOnZellijExit = true;
|
||||
};
|
||||
bash.enable = true;
|
||||
zsh.enable = true;
|
||||
|
@ -37,5 +41,15 @@
|
|||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
'eval (@zellij@/bin/dummy setup --generate-auto-start fish | string collect)'
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
'eval (@zellij@/bin/dummy setup --generate-completion fish | string collect)'
|
||||
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileContains \
|
||||
home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'export ZELLIJ_AUTO_ATTACH="true"'
|
||||
assertFileContains \
|
||||
home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'export ZELLIJ_AUTO_EXIT="true"'
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue