1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-05 10:49:44 +01:00
home-manager/modules/programs/thefuck.nix

42 lines
982 B
Nix
Raw Normal View History

2023-10-01 16:41:55 +02:00
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.programs.thefuck;
in {
meta.maintainers = [ hm.maintainers.ilaumjd ];
options.programs.thefuck = {
enable = mkEnableOption
"thefuck - magnificent app that corrects your previous console command";
package = mkPackageOption pkgs "thefuck" { };
enableBashIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Bash integration.
'';
};
enableZshIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Zsh integration.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
eval "$(${cfg.package}/bin/thefuck --alias)"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/thefuck --alias)"
'';
};
}