pistol: add module
This commit is contained in:
parent
65bcfaccc5
commit
223b9deead
8 changed files with 99 additions and 0 deletions
31
tests/modules/programs/pistol/config.nix
Normal file
31
tests/modules/programs/pistol/config.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
expected = builtins.toFile "settings-expected" ''
|
||||
application/json bat --paging=never --color=always --style=auto --wrap=character --terminal-width=%pistol-extra0% --line-range=1:%pistol-extra1% %pistol-filename%
|
||||
text/* bat --paging=never --color=always --style=auto --wrap=character --terminal-width=%pistol-extra0% --line-range=1:%pistol-extra1% %pistol-filename%'';
|
||||
|
||||
in {
|
||||
programs.pistol = {
|
||||
enable = true;
|
||||
config = {
|
||||
"text/*" =
|
||||
"bat --paging=never --color=always --style=auto --wrap=character --terminal-width=%pistol-extra0% --line-range=1:%pistol-extra1% %pistol-filename%";
|
||||
"application/json" =
|
||||
"bat --paging=never --color=always --style=auto --wrap=character --terminal-width=%pistol-extra0% --line-range=1:%pistol-extra1% %pistol-filename%";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.pistol = { };
|
||||
|
||||
nmt.script = let
|
||||
path = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
"home-files/Library/Application Support/pistol/pistol.conf"
|
||||
else
|
||||
"home-files/.config/pistol/pistol.conf";
|
||||
in ''
|
||||
assertFileExists '${path}'
|
||||
assertFileContent '${path}' '${expected}'
|
||||
'';
|
||||
}
|
||||
1
tests/modules/programs/pistol/default.nix
Normal file
1
tests/modules/programs/pistol/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ pistol-config = ./config.nix; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue