scmpuff: add fish integration flag

This commit is contained in:
Phillip Cloud 2022-08-22 05:38:58 -04:00 committed by Robert Helgesson
parent 3ce1c4787a
commit f7641a3ff3
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 55 additions and 0 deletions

View file

@ -31,6 +31,14 @@ in {
Whether to enable Zsh integration.
'';
};
enableFishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable fish integration.
'';
};
};
config = mkIf cfg.enable {
@ -43,5 +51,10 @@ in {
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/scmpuff init -s)"
'';
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration
(mkAfter ''
${cfg.package}/bin/scmpuff init -s --shell=fish | source
'');
};
}