mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 15:19:45 +01:00
41 lines
982 B
Nix
41 lines
982 B
Nix
{ 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)"
|
|
'';
|
|
};
|
|
}
|