fork/home-manager

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

Bernardo Meurerbat: allow setting themes/syntaxes without IFD44635279

master
1.7 KiB67 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 = ''
17        This is a test theme.
18      '';
19
20      syntaxes.testsyntax = ''
21        This is a test syntax.
22      '';
23    };
24
25    test.stubs.bat = { };
26
27    test.asserts.warnings.enable = true;
28    test.asserts.warnings.expected = [
29      ''
30        Using programs.bat.themes as a string option is deprecated and will be
31        removed in the future. Please change to using it as an attribute set
32        instead.
33      ''
34      ''
35        Using programs.bat.syntaxes as a string option is deprecated and will be
36        removed in the future. Please change to using it as an attribute set
37        instead.
38      ''
39    ];
40
41    nmt.script = ''
42      assertFileExists home-files/.config/bat/config
43      assertFileContent home-files/.config/bat/config ${
44        pkgs.writeText "bat.expected" ''
45          --map-syntax='*.jenkinsfile:Groovy'
46          --map-syntax='*.props:Java Properties'
47          --pager='less -FR'
48          --theme='TwoDark'
49        ''
50      }
51
52      assertFileExists home-files/.config/bat/themes/testtheme.tmTheme
53      assertFileContent home-files/.config/bat/themes/testtheme.tmTheme ${
54        pkgs.writeText "bat.expected" ''
55          This is a test theme.
56        ''
57      }
58
59      assertFileExists home-files/.config/bat/syntaxes/testsyntax.sublime-syntax
60      assertFileContent home-files/.config/bat/syntaxes/testsyntax.sublime-syntax ${
61        pkgs.writeText "bat.expected" ''
62          This is a test syntax.
63        ''
64      }
65    '';
66  };
67}