blob: 79eefab50025db0b6218e3e3932c2dd94054bc28 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
{
lib,
pkgs,
config,
...
}:
{
users.users = {
alice = {
isNormalUser = true;
description = "Alice Foobar";
password = "foobar";
uid = 1000;
};
untrusted = {
isNormalUser = true;
description = "Untrusted user";
password = "foobar";
uid = 1001;
# For deny unmapped uid test:
packages = [ config.environment.hakurei.package ];
};
};
home-manager.users.alice.home.stateVersion = "24.11";
# Automatically login on tty1 as a normal user:
services.getty.autologinUser = "alice";
environment = {
systemPackages = with pkgs; [
# For D-Bus tests:
mako
libnotify
];
variables = {
SWAYSOCK = "/tmp/sway-ipc.sock";
WLR_RENDERER = "pixman";
};
# To help with OCR:
etc."xdg/foot/foot.ini".text = lib.generators.toINI { } {
main = {
font = "inconsolata:size=14";
};
colors = rec {
foreground = "000000";
background = "ffffff";
regular2 = foreground;
};
};
};
fonts.packages = [ pkgs.inconsolata ];
# Automatically configure and start Sway when logging in on tty1:
programs.bash.loginShellInit = ''
if [ "$(tty)" = "/dev/tty1" ]; then
set -e
mkdir -p ~/.config/sway
(sed s/Mod4/Mod1/ /etc/sway/config &&
echo 'output * bg ${pkgs.nixos-artwork.wallpapers.simple-light-gray.gnomeFilePath} fill' &&
echo 'output Virtual-1 res 1680x1050') > ~/.config/sway/config
sway --validate
systemd-cat --identifier=session sway && touch /tmp/sway-exit-ok
fi
'';
programs.sway.enable = true;
# For PulseAudio tests:
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
virtualisation = {
# Hopefully reduces spurious test failures:
memorySize = if pkgs.stdenv.hostPlatform.is32bit then 2046 else 8192;
qemu.options = [
# Need to switch to a different GPU driver than the default one (-vga std) so that Sway can launch:
"-vga none -device virtio-gpu-pci"
# Increase Go test compiler performance:
"-smp 16"
];
};
environment.hakurei = {
enable = true;
stateDir = "/var/lib/hakurei";
users.alice = 0;
extraHomeConfig =
{ config, ... }:
{
# To test merge deduplication:
options._hakurei.stateVersion = lib.mkOption { type = lib.types.str; };
config = {
home = { inherit (config._hakurei) stateVersion; };
_hakurei.stateVersion = "23.05";
};
};
commonPaths = [
{
type = "bind";
src = "/var/tmp";
write = true;
}
];
apps = {
"cat.gensokyo.extern.bash.linger-timeout" = {
name = "hakurei-check-linger-timeout";
identity = 9999;
share = pkgs.bash;
packages = [ pkgs.bash ];
command = ''
sleep infinity & disown
exit
'';
wait_delay = 1;
enablements = {
wayland = false;
pipewire = false;
};
};
"cat.gensokyo.extern.foot.noEnablements" = {
name = "ne-foot";
identity = 1;
shareUid = true;
verbose = true;
share = pkgs.foot;
packages = with pkgs; [
foot
# For wayland-info:
wayland-utils
];
command = "foot";
enablements = {
dbus = false;
pipewire = false;
};
};
"cat.gensokyo.extern.foot.noEnablements.immediate" = {
name = "ne-foot-immediate";
identity = 1;
shareUid = true;
verbose = true;
wait_delay = -1;
share = pkgs.foot;
packages = [ ];
command = "foot";
enablements = {
dbus = false;
pipewire = false;
};
};
"cat.gensokyo.extern.foot.pulseaudio" = {
name = "pa-foot";
identity = 2;
verbose = true;
share = pkgs.foot;
packages = [ pkgs.foot ];
command = "foot";
enablements.dbus = false;
};
"cat.gensokyo.extern.Alacritty.x11" = {
name = "x11-alacritty";
identity = 1;
shareUid = true;
verbose = true;
share = pkgs.alacritty;
packages = with pkgs; [
# For X11 terminal emulator:
alacritty
# For glinfo:
mesa-demos
];
command = "alacritty";
enablements = {
wayland = false;
x11 = true;
dbus = false;
pipewire = false;
};
};
"cat.gensokyo.extern.foot.directWayland" = {
name = "da-foot";
identity = 4;
verbose = true;
insecureWayland = true;
share = pkgs.foot;
packages = with pkgs; [
foot
# For wayland-info:
wayland-utils
];
command = "foot";
enablements = {
dbus = false;
pipewire = false;
};
};
"cat.gensokyo.extern.strace.wantFail" = {
name = "strace-failure";
identity = 5;
verbose = true;
share = pkgs.strace;
command = "strace true";
enablements = {
wayland = false;
x11 = false;
dbus = false;
pipewire = false;
};
};
};
};
}
|