git.iko.soy/typeable/nixpkgs
on master help sign in
programs.thefuck: support shells that don't use `/etc/profile`
commit26655f505ff7cc692321bc7d11821ec55c49da7c authorMaximilian Bosch <maximilian@mbosch.me> dateSun 23 Jul 2017, 09:22 (9 years ago) parent8977bee
1 file changed+11−3
nixos/modules/programs/thefuck.nix+11−3
nixos/modules/programs/thefuck.nix+11−3
@@ -3,7 +3,12 @@
33with lib;
44
55let
6− cfg = config.programs.thefuck;
6+ prg = config.programs;
7+ cfg = prg.thefuck;
8+
9+ initScript = ''
10+ eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
11+ '';
712in
813 {
914 options = {
@@ -24,8 +29,11 @@ in
2429
2530 config = mkIf cfg.enable {
2631 environment.systemPackages = with pkgs; [ thefuck ];
27− environment.shellInit = ''
28− eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
32+ environment.shellInit = initScript;
33+
34+ programs.zsh.shellInit = mkIf prg.zsh.enable initScript;
35+ programs.fish.shellInit = mkIf prg.fish.enable ''
36+ ${pkgs.thefuck}/bin/thefuck --alias | source
2937 '';
3038 };
3139 }