fork/home-manager
git clone https://git.julia.blue/fork/home-manager
3e1f8df4
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5{ 6meta . maintainers = [ hm . maintainers . ilaumjd ]; 7 8options . programs . thefuck = { 9enable = mkEnableOption 10"thefuck - magnificent app that corrects your previous console command" ; 11 12package = mkPackageOption pkgs "thefuck" { }; 13 14enableInstantMode = mkEnableOption "thefuck's experimental instant mode" ; 15 16enableBashIntegration = mkOption { 17default = true ; 18type = types . bool ; 19description = '' 20Whether to enable Bash integration. 21'' ; 22}; 23 24enableZshIntegration = mkOption { 25default = true ; 26type = types . bool ; 27description = '' 28Whether to enable Zsh integration. 29'' ; 30}; 31}; 32 33config = let 34cfg = config . programs . thefuck ; 35 36cliArgs = cli . toGNUCommandLineShell { } { 37alias = true ; 38enable-experimental-instant-mode = cfg . enableInstantMode ; 39}; 40 41shEvalCmd = '' 42eval "$( ${ cfg . package } /bin/thefuck ${ cliArgs } )" 43'' ; 44in mkIf cfg . enable { 45home . packages = [ cfg . package ]; 46 47programs . bash . initExtra = mkIf cfg . enableBashIntegration shEvalCmd ; 48 49programs . zsh . initExtra = mkIf cfg . enableZshIntegration shEvalCmd ; 50}; 51}