Merge pull request #171152 from Luflosi/thefuck-improvements
nixos/thefuck: fix programs.thefuck.alias for fish
This commit is contained in:
commit
c8bbc62a64
|
@ -6,9 +6,12 @@ let
|
||||||
prg = config.programs;
|
prg = config.programs;
|
||||||
cfg = prg.thefuck;
|
cfg = prg.thefuck;
|
||||||
|
|
||||||
initScript = ''
|
bashAndZshInitScript = ''
|
||||||
eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
|
eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
|
||||||
'';
|
'';
|
||||||
|
fishInitScript = ''
|
||||||
|
${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias} | source
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -30,10 +33,8 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [ thefuck ];
|
environment.systemPackages = with pkgs; [ thefuck ];
|
||||||
|
|
||||||
programs.bash.interactiveShellInit = initScript;
|
programs.bash.interactiveShellInit = bashAndZshInitScript;
|
||||||
programs.zsh.interactiveShellInit = mkIf prg.zsh.enable initScript;
|
programs.zsh.interactiveShellInit = mkIf prg.zsh.enable bashAndZshInitScript;
|
||||||
programs.fish.interactiveShellInit = mkIf prg.fish.enable ''
|
programs.fish.interactiveShellInit = mkIf prg.fish.enable fishInitScript;
|
||||||
${pkgs.thefuck}/bin/thefuck --alias | source
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue