mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-23 02:39:40 +01:00
thefuck: add module
This commit is contained in:
parent
b0e0d82696
commit
2874c6fce6
7 changed files with 95 additions and 0 deletions
41
modules/programs/thefuck.nix
Normal file
41
modules/programs/thefuck.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ 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)"
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue