diff --git a/modules/programs/zellij.nix b/modules/programs/zellij.nix index 838684ea..079d20c0 100644 --- a/modules/programs/zellij.nix +++ b/modules/programs/zellij.nix @@ -49,7 +49,13 @@ in { default = false; }; - enableFishIntegration = mkEnableOption "Fish integration" // { + enableFishIntegration = mkEnableOption "Fish integration (enables both enableFishAutostart and enableFishCompletions)" // { + default = false; + }; + enableFishAutostart = mkEnableOption "autostart zellij in interactive sessions" // { + default = false; + }; + enableFishCompletions = mkEnableOption "load zellij completions" // { default = false; }; }; @@ -77,10 +83,15 @@ 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) - eval (${zellijCmd} setup --generate-completion fish | string collect) - ''); + 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 "") + )); + }; }