mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #27578 from Ma27/bugfix/thefuck/support-for-non-posix-compliant-shells
programs.thefuck: support shells that don't use `/etc/profile`
This commit is contained in:
commit
12e8bea477
1 changed files with 11 additions and 3 deletions
|
@ -3,7 +3,12 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.thefuck;
|
prg = config.programs;
|
||||||
|
cfg = prg.thefuck;
|
||||||
|
|
||||||
|
initScript = ''
|
||||||
|
eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -24,8 +29,11 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [ thefuck ];
|
environment.systemPackages = with pkgs; [ thefuck ];
|
||||||
environment.shellInit = ''
|
environment.shellInit = initScript;
|
||||||
eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
|
|
||||||
|
programs.zsh.shellInit = mkIf prg.zsh.enable initScript;
|
||||||
|
programs.fish.shellInit = mkIf prg.fish.enable ''
|
||||||
|
${pkgs.thefuck}/bin/thefuck --alias | source
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue