1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-12 12:01:08 +01:00
home-manager/tests/modules/programs/pistol/associations.nix
2025-09-10 13:39:08 -05:00

38 lines
963 B
Nix

{ pkgs, ... }:
{
programs.pistol = {
enable = true;
associations = [
{
mime = "application/json";
command = "bat %pistol-filename%";
}
{
mime = "application/*";
command = "hexyl %pistol-filename%";
}
{
fpath = ".*.md$";
command = "sh: bat --paging=never --color=always %pistol-filename% | head -8";
}
];
};
nmt.script =
let
expected = builtins.toFile "config-expected" ''
application/json bat %pistol-filename%
application/* hexyl %pistol-filename%
fpath .*.md$ sh: bat --paging=never --color=always %pistol-filename% | head -8'';
path =
if pkgs.stdenv.hostPlatform.isDarwin then
"home-files/Library/Preferences/pistol/pistol.conf"
else
"home-files/.config/pistol/pistol.conf";
in
''
assertFileExists '${path}'
assertFileContent '${path}' '${expected}'
'';
}