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.
This commit is contained in:
parent
9add6bdfc8
commit
536a78ecc9
@ -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;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user