1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/modules/programs/ripgrep-all/custom-arguments.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

55 lines
1.5 KiB
Nix

{ pkgs, config, ... }:
{
config = {
programs.ripgrep-all = {
enable = true;
package = config.lib.test.mkStubPackage { name = "ripgrep-all"; };
custom_adapters = [
{
name = "gron";
version = 1;
description = "Transform JSON into discrete JS assignments";
extensions = [ "json" ];
mimetypes = [ "application/json" ];
binary = "/bin/gron";
disabled_by_default = false;
match_only_by_mime = false;
}
];
};
nmt.script =
let
configPath =
if pkgs.stdenv.hostPlatform.isDarwin then
"Library/Application Support/ripgrep-all/config.jsonc"
else
".config/ripgrep-all/config.jsonc";
in
''
assertFileExists "home-files/${configPath}"
assertFileContent "home-files/${configPath}" ${pkgs.writeText "ripgrep-all.expected" ''
{
"$schema": "./config.schema.json",
"custom_adapters": [
{
"args": [],
"binary": "/bin/gron",
"description": "Transform JSON into discrete JS assignments",
"disabled_by_default": false,
"extensions": [
"json"
],
"match_only_by_mime": false,
"mimetypes": [
"application/json"
],
"name": "gron",
"version": 1
}
]
}
''}
'';
};
}