From 536a78ecc92688f186d44c8022054ff15de190db Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sun, 1 May 2022 18:00:18 +0200 Subject: [PATCH] nixos/thefuck: rename variable and move fishInitScript into its own variable Renaming the variable from `initScript` to `bashAndZshInitScript` makes it clearer, what it is actually used for. Moving the fish init script right below the other call to `thefuck --alias` makes it more obvious, when one of them is different in some important way. --- nixos/modules/programs/thefuck.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nixos/modules/programs/thefuck.nix b/nixos/modules/programs/thefuck.nix index fa5f8290c622..18d09e26866c 100644 --- a/nixos/modules/programs/thefuck.nix +++ b/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 ${cfg.alias} | source - ''; + programs.bash.interactiveShellInit = bashAndZshInitScript; + programs.zsh.interactiveShellInit = mkIf prg.zsh.enable bashAndZshInitScript; + programs.fish.interactiveShellInit = mkIf prg.fish.enable fishInitScript; }; }