diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2017-07-23 09:22:33 +0200 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2017-07-30 08:23:35 +0200 |
commit | 26655f505ff7cc692321bc7d11821ec55c49da7c (patch) | |
tree | f495162ae2a1f88801553759f3bfb3dbf02da9a4 /nixos/modules/programs/thefuck.nix | |
parent | 8977bee504234637e5649e9d800ad57d8d21dd6f (diff) |
programs.thefuck: support shells that don't use `/etc/profile`
Diffstat (limited to 'nixos/modules/programs/thefuck.nix')
-rw-r--r-- | nixos/modules/programs/thefuck.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/nixos/modules/programs/thefuck.nix b/nixos/modules/programs/thefuck.nix index 433a0ca95fef..eb913477cf05 100644 --- a/nixos/modules/programs/thefuck.nix +++ b/nixos/modules/programs/thefuck.nix @@ -3,7 +3,12 @@ with lib; let - cfg = config.programs.thefuck; + prg = config.programs; + cfg = prg.thefuck; + + initScript = '' + eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias}) + ''; in { options = { @@ -24,8 +29,11 @@ in config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ thefuck ]; - environment.shellInit = '' - eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias}) + environment.shellInit = initScript; + + programs.zsh.shellInit = mkIf prg.zsh.enable initScript; + programs.fish.shellInit = mkIf prg.fish.enable '' + ${pkgs.thefuck}/bin/thefuck --alias | source ''; }; } |