fork/home-manager

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

Bernardo Meurerbat: allow setting themes/syntaxes without IFD44635279

master
1.3 KiB53 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6  config = {
7    programs.bat = {
8      enable = true;
9
10      config = {
11        theme = "TwoDark";
12        pager = "less -FR";
13        map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ];
14      };
15
16      themes.testtheme.src = pkgs.writeText "testtheme.tmTheme" ''
17        This is a test theme.
18      '';
19
20      syntaxes.testsyntax.src = pkgs.writeText "testsyntax.sublime-syntax" ''
21        This is a test syntax.
22      '';
23    };
24
25    test.stubs.bat = { };
26
27    nmt.script = ''
28      assertFileExists home-files/.config/bat/config
29      assertFileContent home-files/.config/bat/config ${
30        pkgs.writeText "bat.expected" ''
31          --map-syntax='*.jenkinsfile:Groovy'
32          --map-syntax='*.props:Java Properties'
33          --pager='less -FR'
34          --theme='TwoDark'
35        ''
36      }
37
38      assertFileExists home-files/.config/bat/themes/testtheme.tmTheme
39      assertFileContent home-files/.config/bat/themes/testtheme.tmTheme ${
40        pkgs.writeText "bat.expected" ''
41          This is a test theme.
42        ''
43      }
44
45      assertFileExists home-files/.config/bat/syntaxes/testsyntax.sublime-syntax
46      assertFileContent home-files/.config/bat/syntaxes/testsyntax.sublime-syntax ${
47        pkgs.writeText "bat.expected" ''
48          This is a test syntax.
49        ''
50      }
51    '';
52  };
53}