sheldon: fix how commands are combined

This commit is contained in:
Kyure_A 2024-07-30 21:29:22 +09:00
parent 6c65ca95fc
commit abfc68ac8f

View file

@ -46,28 +46,49 @@ in {
source = tomlFormat.generate "sheldon-config" cfg.settings; source = tomlFormat.generate "sheldon-config" cfg.settings;
}; };
programs.bash.initExtra = mkIf (cfg.settings != { }) '' programs.bash.initExtra = concatStringsSep "\n" [
mkIf
(cfg.settings != { })
''
eval "$(sheldon source)" eval "$(sheldon source)"
'' + mkIf cfg.enableBashCompletions '' ''
mkIf
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 = mkIf (cfg.settings != { }) '' programs.zsh.initExtra = concatStringsSep "\n" [
mkIf
(cfg.settings != { })
''
eval "$(sheldon source)" eval "$(sheldon source)"
'' + mkIf cfg.enableZshCompletions '' ''
mkIf
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 = mkIf (cfg.settings != { }) '' programs.fish.interactiveShellInit = concatStringsSep "\n" [
mkIf
(cfg.settings != { })
''
eval "$(sheldon source)" eval "$(sheldon source)"
'' + mkIf cfg.enableFishCompletions '' ''
mkIf
cfg.enableFishCompletions
''
if test "$TERM" != "dumb" if test "$TERM" != "dumb"
eval "$(${cmd} completions --shell=fish)" eval "$(${cmd} completions --shell=fish)"
end end
''; ''
];
}; };
} }