aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/programs/autorandr/basic-configuration.nix
blob: 190511016fe2cd696a01b1bb215895a41abd9345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ config, pkgs, ... }:

{
  config = {
    programs.autorandr = {
      enable = true;
      profiles = {
        default = {
          fingerprint = {
            DP1 = "XXX";
            DP2 = "YYY";
          };
          config = {
            DP1.enable = false;
            DP2 = {
              crtc = 0;
              primary = true;
              position = "0x0";
              mode = "1920x1080";
              scale = {
                x = 2;
                y = 4;
              };
              transform = [
                [ 0.6 0.0 0.0 ] # a b c
                [ 0.0 0.6 0.0 ] # d e f
                [ 0.0 0.0 1.0 ] # g h i
              ];
            };
          };
        };
      };
    };

    nmt.script = ''
      config=home-files/.config/autorandr/default/config
      setup=home-files/.config/autorandr/default/setup

      assertFileExists $setup
      assertFileRegex $setup 'DP1 XXX'
      assertFileRegex $setup 'DP2 YYY'

      assertFileExists $config
      assertFileContent $config \
          ${./basic-configuration.conf}
    '';
  };
}