1 { config, pkgs, lib, ... }:
7 bashAndZshInitScript = ''
8 eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
11 ${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias} | source
17 enable = lib.mkEnableOption "thefuck, an app which corrects your previous console command";
19 alias = lib.mkOption {
24 `thefuck` needs an alias to be configured.
25 The default value is `fuck`, but you can use anything else as well.
31 config = lib.mkIf cfg.enable {
32 environment.systemPackages = with pkgs; [ thefuck ];
34 programs.bash.interactiveShellInit = bashAndZshInitScript;
35 programs.zsh.interactiveShellInit = lib.mkIf prg.zsh.enable bashAndZshInitScript;
36 programs.fish.interactiveShellInit = lib.mkIf prg.fish.enable fishInitScript;