direnv: make fish enable flag read-only

We cannot disable direnv for Fish since the functionality is
automatically loaded when the package is installed.

Fixes #2357
This commit is contained in:
Robert Helgesson 2021-10-21 22:18:50 +02:00
parent 91155a98ed
commit 3e4fedc1d9
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
1 changed files with 4 additions and 5 deletions

View File

@ -66,8 +66,11 @@ in {
enableFishIntegration = mkOption {
default = true;
type = types.bool;
readOnly = true;
description = ''
Whether to enable Fish integration.
Whether to enable Fish integration. Note, enabling the direnv module
will always active its functionality for Fish since the direnv package
automatically gets loaded in Fish.
'';
};
@ -106,9 +109,5 @@ in {
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
'';
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
${pkgs.direnv}/bin/direnv hook fish | source
'';
};
}