summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2017-07-30 11:13:07 +0100
committerGitHub <noreply@github.com>2017-07-30 11:13:07 +0100
commit12e8bea4776021f1dba8d273a31f27284b572371 (patch)
tree70d71f783ee6b5ffb70f55048893c221c6443fb0
parentd160d1b40817bf1b8646e63a30e354ff3ad8b40c (diff)
parent26655f505ff7cc692321bc7d11821ec55c49da7c (diff)
downloadnixlib-12e8bea4776021f1dba8d273a31f27284b572371.tar
nixlib-12e8bea4776021f1dba8d273a31f27284b572371.tar.gz
nixlib-12e8bea4776021f1dba8d273a31f27284b572371.tar.bz2
nixlib-12e8bea4776021f1dba8d273a31f27284b572371.tar.lz
nixlib-12e8bea4776021f1dba8d273a31f27284b572371.tar.xz
nixlib-12e8bea4776021f1dba8d273a31f27284b572371.tar.zst
nixlib-12e8bea4776021f1dba8d273a31f27284b572371.zip
Merge pull request #27578 from Ma27/bugfix/thefuck/support-for-non-posix-compliant-shells
programs.thefuck: support shells that don't use `/etc/profile`
-rw-r--r--nixos/modules/programs/thefuck.nix14
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
       '';
     };
   }