sheldon: change mkIf to be enclosed in parentheses

This commit is contained in:
Kyure_A 2024-07-30 21:59:36 +09:00
parent cdb8ea396e
commit a63b850066

View file

@ -47,48 +47,36 @@ in {
}; };
programs.bash.initExtra = builtins.concatStringsSep "\n" [ programs.bash.initExtra = builtins.concatStringsSep "\n" [
mkIf (mkIf (cfg.settings != { }) ''
(cfg.settings != { })
''
eval "$(sheldon source)" eval "$(sheldon source)"
'' '')
mkIf (mkIf cfg.enableBashCompletions ''
cfg.enableBashCompletions
''
if [[ $TERM != "dumb" ]]; then if [[ $TERM != "dumb" ]]; then
eval "$(${cmd} completions --shell=bash)" eval "$(${cmd} completions --shell=bash)"
fi fi
'' '')
]; ];
programs.zsh.initExtra = builtins.concatStringsSep "\n" [ programs.zsh.initExtra = builtins.concatStringsSep "\n" [
mkIf (mkIf (cfg.settings != { }) ''
(cfg.settings != { })
''
eval "$(sheldon source)" eval "$(sheldon source)"
'' '')
mkIf (mkIf cfg.enableZshCompletions ''
cfg.enableZshCompletions
''
if [[ $TERM != "dumb" ]]; then if [[ $TERM != "dumb" ]]; then
eval "$(${cmd} completions --shell=zsh)" eval "$(${cmd} completions --shell=zsh)"
fi fi
'' '')
]; ];
programs.fish.interactiveShellInit = builtins.concatStringsSep "\n" [ programs.fish.interactiveShellInit = builtins.concatStringsSep "\n" [
mkIf (mkIf (cfg.settings != { }) ''
(cfg.settings != { })
''
eval "$(sheldon source)" eval "$(sheldon source)"
'' '')
mkIf (mkIf cfg.enableFishCompletions ''
cfg.enableFishCompletions
''
if test "$TERM" != "dumb" if test "$TERM" != "dumb"
eval "$(${cmd} completions --shell=fish)" eval "$(${cmd} completions --shell=fish)"
end end
'' '')
]; ];
}; };
} }