fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Matthew Tooheypistol: refactorb7eb400d

master
963 B38 linesraw
1{ pkgs, ... }:
2
3{
4  programs.pistol = {
5    enable = true;
6    associations = [
7      {
8        mime = "application/json";
9        command = "bat %pistol-filename%";
10      }
11      {
12        mime = "application/*";
13        command = "hexyl %pistol-filename%";
14      }
15      {
16        fpath = ".*.md$";
17        command =
18          "sh: bat --paging=never --color=always %pistol-filename% | head -8";
19      }
20    ];
21  };
22
23  test.stubs.pistol = { };
24
25  nmt.script = let
26    expected = builtins.toFile "config-expected" ''
27      application/json bat %pistol-filename%
28      application/* hexyl %pistol-filename%
29      fpath .*.md$ sh: bat --paging=never --color=always %pistol-filename% | head -8'';
30    path = if pkgs.stdenv.hostPlatform.isDarwin then
31      "home-files/Library/Application Support/pistol/pistol.conf"
32    else
33      "home-files/.config/pistol/pistol.conf";
34  in ''
35    assertFileExists '${path}'
36    assertFileContent '${path}' '${expected}'
37  '';
38}