sheldon: fix expression type

This commit is contained in:
Kyure_A 2024-07-31 19:36:31 +09:00
parent a63b850066
commit fbd892591c

View file

@ -5,7 +5,7 @@ with lib;
let let
cfg = config.programs.sheldon; cfg = config.programs.sheldon;
tomlFormat = pkgs.formats.toml { }; tomlFormat = pkgs.formats.toml { };
cmd = "${config.home.profileDirectory}/bin/sheldon"; sheldonCmd = "${config.home.profileDirectory}/bin/sheldon";
in { in {
meta.maintainers = [ maintainers.Kyure-A ]; meta.maintainers = [ maintainers.Kyure-A ];
@ -46,37 +46,37 @@ in {
source = tomlFormat.generate "sheldon-config" cfg.settings; source = tomlFormat.generate "sheldon-config" cfg.settings;
}; };
programs.bash.initExtra = builtins.concatStringsSep "\n" [ programs.bash.initExtra = ''
(mkIf (cfg.settings != { }) '' ${optionalString (cfg.settings != { }) ''
eval "$(sheldon source)" eval "$(sheldon source)"
'') ''}
(mkIf cfg.enableBashCompletions '' ${optionalString cfg.enableBashCompletions ''
if [[ $TERM != "dumb" ]]; then if [[ $TERM != "dumb" ]]; then
eval "$(${cmd} completions --shell=bash)" eval "$(${sheldonCmd} completions --shell=bash)"
fi fi
'') ''}
]; '';
programs.zsh.initExtra = builtins.concatStringsSep "\n" [ programs.zsh.initExtra = ''
(mkIf (cfg.settings != { }) '' ${optionalString (cfg.settings != { }) ''
eval "$(sheldon source)" eval "$(sheldon source)"
'') ''}
(mkIf cfg.enableZshCompletions '' ${optionalString cfg.enableZshCompletions ''
if [[ $TERM != "dumb" ]]; then if [[ $TERM != "dumb" ]]; then
eval "$(${cmd} completions --shell=zsh)" eval "$(${sheldonCmd} completions --shell=zsh)"
fi fi
'') ''}
]; '';
programs.fish.interactiveShellInit = builtins.concatStringsSep "\n" [ programs.fish.interactiveShellInit = ''
(mkIf (cfg.settings != { }) '' ${optionalString (cfg.settings != { }) ''
eval "$(sheldon source)" eval "$(sheldon source)"
'') ''}
(mkIf cfg.enableFishCompletions '' ${optionalString cfg.enableFishCompletions ''
if test "$TERM" != "dumb" if test "$TERM" != "dumb"
eval "$(${cmd} completions --shell=fish)" eval "$(${sheldonCmd} completions --shell=fish)"
end end
'') ''}
]; '';
}; };
} }