mirror of
https://github.com/nix-community/home-manager
synced 2024-11-20 01:59:45 +01:00
ripgrep: remove configDir
Also minor formatting and news entry.
This commit is contained in:
parent
2951946183
commit
bffc49ffb2
2 changed files with 16 additions and 17 deletions
|
@ -1033,12 +1033,20 @@ in
|
||||||
defaults to 'null'.
|
defaults to 'null'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
time = "2023-05-18T21:03:30+00:00";
|
time = "2023-05-18T21:03:30+00:00";
|
||||||
message = ''
|
message = ''
|
||||||
A new module is available: 'programs.script-directory'.
|
A new module is available: 'programs.script-directory'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2023-06-03T22:19:32+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.ripgrep'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let cfg = config.programs.ripgrep;
|
let
|
||||||
|
cfg = config.programs.ripgrep;
|
||||||
|
configPath = "${config.xdg.configHome}/ripgrep/ripgreprc";
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ hm.maintainers.pedorich-n ];
|
meta.maintainers = [ hm.maintainers.pedorich-n ];
|
||||||
|
|
||||||
|
@ -12,23 +14,14 @@ in {
|
||||||
|
|
||||||
package = mkPackageOption pkgs "ripgrep" { };
|
package = mkPackageOption pkgs "ripgrep" { };
|
||||||
|
|
||||||
configDir = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "${config.xdg.configHome}/ripgrep";
|
|
||||||
defaultText =
|
|
||||||
literalExpression ''"''${config.xdg.configHome}/ripgrep"'';
|
|
||||||
description = ''
|
|
||||||
Directory where the <filename>ripgreprc</filename> file will be stored.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
arguments = mkOption {
|
arguments = mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [ "--max-columns-preview" "--colors=line:style:bold" ];
|
example = [ "--max-columns-preview" "--colors=line:style:bold" ];
|
||||||
description = ''
|
description = ''
|
||||||
List of arguments to pass to ripgrep. Each item is given to ripgrep as a single command line argument verbatim.
|
List of arguments to pass to ripgrep. Each item is given to ripgrep as
|
||||||
|
a single command line argument verbatim.
|
||||||
|
</para><para>
|
||||||
See <link xlink:href="https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file"/>
|
See <link xlink:href="https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file"/>
|
||||||
for an example configuration.
|
for an example configuration.
|
||||||
'';
|
'';
|
||||||
|
@ -40,12 +33,10 @@ in {
|
||||||
home = {
|
home = {
|
||||||
packages = [ cfg.package ];
|
packages = [ cfg.package ];
|
||||||
|
|
||||||
file."${cfg.configDir}/ripgreprc" =
|
file."${configPath}" =
|
||||||
mkIf (cfg.arguments != [ ]) { text = lib.concatLines cfg.arguments; };
|
mkIf (cfg.arguments != [ ]) { text = lib.concatLines cfg.arguments; };
|
||||||
|
|
||||||
sessionVariables = {
|
sessionVariables = { "RIPGREP_CONFIG_PATH" = configPath; };
|
||||||
"RIPGREP_CONFIG_PATH" = "${cfg.configDir}/ripgreprc";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue