opam: add fish integration (#3422)

This commit is contained in:
alois31 2022-11-18 17:00:57 +01:00 committed by GitHub
parent c94c9c342f
commit 5589b28e66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,6 +34,14 @@ in {
Whether to enable Zsh integration.
'';
};
enableFishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Fish integration.
'';
};
};
config = mkIf cfg.enable {
@ -46,5 +54,9 @@ in {
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/opam env --shell=zsh)"
'';
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
eval "$(${cfg.package}/bin/opam env --shell=fish)"
'';
};
}