fork/home-manager
git clone https://git.julia.blue/fork/home-manager
0841242b
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6cfg = config . programs . ripgrep ; 7configPath = " ${ config . xdg . configHome } /ripgrep/ripgreprc" ; 8in { 9meta . maintainers = [ hm . maintainers . pedorich-n ]; 10 11options = { 12programs . ripgrep = { 13enable = mkEnableOption "Ripgrep" ; 14 15package = mkPackageOption pkgs "ripgrep" { }; 16 17arguments = mkOption { 18type = with types ; listOf str ; 19default = [ ]; 20example = [ "--max-columns-preview" "--colors=line:style:bold" ]; 21description = '' 22List of arguments to pass to ripgrep. Each item is given to ripgrep as 23a single command line argument verbatim. 24 25See <https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file> 26for an example configuration. 27'' ; 28}; 29}; 30}; 31 32config = mkIf cfg . enable { 33home = mkMerge [ 34{ packages = [ cfg . package ]; } 35( mkIf ( cfg . arguments != [ ]) { 36file . " ${ configPath } " . text = lib . concatLines cfg . arguments ; 37 38sessionVariables . "RIPGREP_CONFIG_PATH" = configPath ; 39}) 40]; 41}; 42}