Merge pull request #171152 from Luflosi/thefuck-improvements

nixos/thefuck: fix programs.thefuck.alias for fish
main
Artturi 2 years ago committed by GitHub
commit c8bbc62a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      nixos/modules/programs/thefuck.nix

@ -6,9 +6,12 @@ let
prg = config.programs;
cfg = prg.thefuck;
initScript = ''
bashAndZshInitScript = ''
eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
'';
fishInitScript = ''
${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias} | source
'';
in
{
options = {
@ -30,10 +33,8 @@ in
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ thefuck ];
programs.bash.interactiveShellInit = initScript;
programs.zsh.interactiveShellInit = mkIf prg.zsh.enable initScript;
programs.fish.interactiveShellInit = mkIf prg.fish.enable ''
${pkgs.thefuck}/bin/thefuck --alias | source
'';
programs.bash.interactiveShellInit = bashAndZshInitScript;
programs.zsh.interactiveShellInit = mkIf prg.zsh.enable bashAndZshInitScript;
programs.fish.interactiveShellInit = mkIf prg.fish.enable fishInitScript;
};
}

Loading…
Cancel
Save