fork/home-manager

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

Robert Helgessontests: update to match latest TOML outputf5c15668

master
5.3 KiB209 linesraw
1{ config, lib, pkgs, ... }:
2
3{
4  config = {
5    programs.i3status-rust = {
6      enable = true;
7      bars = {
8        extra-settings = {
9          blocks = [
10            {
11              block = "disk_space";
12              path = "/";
13              info_type = "available";
14              interval = 60;
15              warning = 20.0;
16              alert = 10.0;
17            }
18            {
19              block = "memory";
20              display_type = "memory";
21              format_mem = "{Mug}GB ({Mup}%)";
22              format_swap = "{SUp}%";
23            }
24            {
25              block = "cpu";
26              interval = 1;
27              format = " $icon $barchart ";
28            }
29            {
30              block = "load";
31              interval = 1;
32              format = " $icon $1m $5m ";
33            }
34            {
35              block = "temperature";
36              interval = 10;
37              format = "$icon $min min, $max max, $average avg";
38              chip = "*-isa-*";
39            }
40            {
41              block = "net";
42              device = "enp9s0u2u1u2c2";
43              interval = 5;
44            }
45            {
46              block = "speedtest";
47              format = " ^icon_ping $ping ";
48            }
49            {
50              block = "xrandr";
51              interval =
52                6000; # Because running the commands causes screen lag, see https://github.com/greshake/i3status-rust/issues/668
53            }
54            {
55              block = "sound";
56              format = "{output_name} {volume}%";
57              click = [{
58                button = "left";
59                cmd = "pavucontrol --tab=3";
60              }];
61              mappings = {
62                "alsa_output.pci-0000_00_1f.3.analog-stereo" = "";
63                "bluez_sink.70_26_05_DA_27_A4.a2dp_sink" = "";
64              };
65            }
66            {
67              block = "music";
68              player = "spotify";
69              buttons = [ "play" "prev" "next" ];
70              click = [
71                {
72                  button = "play";
73                  action = "music_play";
74                }
75                {
76                  button = "prev";
77                  action = "music_prev";
78                }
79                {
80                  button = "next";
81                  action = "music_next";
82                }
83              ];
84            }
85            {
86              block = "time";
87              interval = 60;
88              format = " $timestamp.datetime(f:'%a %d/%m %R') ";
89            }
90            { block = "battery"; }
91          ];
92
93          icons = "awesome5";
94
95          settings = {
96            theme = {
97              theme = "solarized-dark";
98              overrides = {
99                idle_bg = "#123456";
100                idle_fg = "#abcdef";
101              };
102            };
103          };
104
105          theme = "gruvbox-dark";
106        };
107      };
108    };
109
110    test.stubs.i3status-rust = { version = "0.30.0"; };
111
112    nmt.script = ''
113      assertFileExists home-files/.config/i3status-rust/config-extra-settings.toml
114      assertFileContent home-files/.config/i3status-rust/config-extra-settings.toml \
115        ${
116          pkgs.writeText "i3status-rust-expected-config" ''
117            [[block]]
118            alert = 10.0
119            block = "disk_space"
120            info_type = "available"
121            interval = 60
122            path = "/"
123            warning = 20.0
124
125            [[block]]
126            block = "memory"
127            display_type = "memory"
128            format_mem = "{Mug}GB ({Mup}%)"
129            format_swap = "{SUp}%"
130
131            [[block]]
132            block = "cpu"
133            format = " $icon $barchart "
134            interval = 1
135
136            [[block]]
137            block = "load"
138            format = " $icon $1m $5m "
139            interval = 1
140
141            [[block]]
142            block = "temperature"
143            chip = "*-isa-*"
144            format = "$icon $min min, $max max, $average avg"
145            interval = 10
146
147            [[block]]
148            block = "net"
149            device = "enp9s0u2u1u2c2"
150            interval = 5
151
152            [[block]]
153            block = "speedtest"
154            format = " ^icon_ping $ping "
155
156            [[block]]
157            block = "xrandr"
158            interval = 6000
159
160            [[block]]
161            block = "sound"
162            format = "{output_name} {volume}%"
163
164            [[block.click]]
165            button = "left"
166            cmd = "pavucontrol --tab=3"
167
168            [block.mappings]
169            "alsa_output.pci-0000_00_1f.3.analog-stereo" = ""
170            "bluez_sink.70_26_05_DA_27_A4.a2dp_sink" = ""
171
172            [[block]]
173            block = "music"
174            buttons = ["play", "prev", "next"]
175            player = "spotify"
176
177            [[block.click]]
178            action = "music_play"
179            button = "play"
180
181            [[block.click]]
182            action = "music_prev"
183            button = "prev"
184
185            [[block.click]]
186            action = "music_next"
187            button = "next"
188
189            [[block]]
190            block = "time"
191            format = " $timestamp.datetime(f:'%a %d/%m %R') "
192            interval = 60
193
194            [[block]]
195            block = "battery"
196
197            [icons]
198            icons = "awesome5"
199
200            [theme]
201            theme = "solarized-dark"
202            [theme.overrides]
203            idle_bg = "#123456"
204            idle_fg = "#abcdef"
205          ''
206        }
207    '';
208  };
209}