Skip to content

Commit 74f2ed6

Browse files
isabelroseskhaneliman
authored andcommitted
test/home-cursor: add new .enable check
1 parent dcc20ac commit 74f2ed6

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

tests/modules/config/home-cursor/default.nix

+120
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,40 @@
3232
config = {
3333
home.pointerCursor = null;
3434

35+
home.stateVersion = "25.05";
36+
37+
test.asserts.warnings.expected = [''
38+
Setting home.pointerCursor to null is deprecated.
39+
Please update your configuration so that
40+
41+
home.pointerCursor.enable = false;
42+
''];
43+
44+
nmt.script = ''
45+
assertPathNotExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme
46+
47+
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
48+
assertFileExists $hmEnvFile
49+
assertFileNotRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"'
50+
assertFileNotRegex $hmEnvFile 'XCURSOR_SIZE="32"'
51+
assertFileNotRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"'
52+
assertFileNotRegex $hmEnvFile 'HYPRCURSOR_SIZE="32"'
53+
'';
54+
};
55+
};
56+
57+
home-cursor-legacy-disabled-with-enable = { realPkgs, ... }: {
58+
config = {
59+
home.pointerCursor = {
60+
enable = false;
61+
package = realPkgs.catppuccin-cursors.macchiatoBlue;
62+
name = "catppuccin-macchiato-blue-standard";
63+
size = 64;
64+
gtk.enable = true;
65+
hyprcursor.enable = true;
66+
x11.enable = true;
67+
};
68+
3569
home.stateVersion = "24.11";
3670

3771
nmt.script = ''
@@ -46,4 +80,90 @@
4680
'';
4781
};
4882
};
83+
84+
home-cursor-legacy-enabled-with-enable = { realPkgs, ... }: {
85+
config = {
86+
home.pointerCursor = {
87+
enable = true;
88+
package = realPkgs.catppuccin-cursors.macchiatoBlue;
89+
name = "catppuccin-macchiato-blue-standard";
90+
size = 64;
91+
gtk.enable = true;
92+
hyprcursor.enable = true;
93+
x11.enable = true;
94+
};
95+
96+
home.stateVersion = "24.11";
97+
98+
nmt.script = ''
99+
assertFileContent \
100+
home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \
101+
${./expected-index.theme}
102+
103+
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
104+
assertFileExists $hmEnvFile
105+
assertFileRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"'
106+
assertFileRegex $hmEnvFile 'XCURSOR_SIZE="64"'
107+
assertFileRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"'
108+
assertFileRegex $hmEnvFile 'HYPRCURSOR_SIZE="64"'
109+
'';
110+
111+
};
112+
};
113+
114+
home-cursor = { realPkgs, ... }: {
115+
config = {
116+
home.pointerCursor = {
117+
enable = true;
118+
package = realPkgs.catppuccin-cursors.macchiatoBlue;
119+
name = "catppuccin-macchiato-blue-standard";
120+
size = 64;
121+
gtk.enable = true;
122+
hyprcursor.enable = true;
123+
x11.enable = true;
124+
};
125+
126+
home.stateVersion = "25.05";
127+
128+
nmt.script = ''
129+
assertFileContent \
130+
home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \
131+
${./expected-index.theme}
132+
133+
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
134+
assertFileExists $hmEnvFile
135+
assertFileRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"'
136+
assertFileRegex $hmEnvFile 'XCURSOR_SIZE="64"'
137+
assertFileRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"'
138+
assertFileRegex $hmEnvFile 'HYPRCURSOR_SIZE="64"'
139+
'';
140+
};
141+
};
142+
143+
home-cursor-disabled = { realPkgs, ... }: {
144+
config = {
145+
home.pointerCursor = {
146+
enable = false;
147+
package = realPkgs.catppuccin-cursors.macchiatoBlue;
148+
name = "catppuccin-macchiato-blue-standard";
149+
size = 64;
150+
gtk.enable = true;
151+
hyprcursor.enable = true;
152+
x11.enable = true;
153+
};
154+
155+
home.stateVersion = "25.05";
156+
157+
nmt.script = ''
158+
assertPathNotExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme
159+
160+
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
161+
assertFileExists $hmEnvFile
162+
assertFileNotRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"'
163+
assertFileNotRegex $hmEnvFile 'XCURSOR_SIZE="32"'
164+
assertFileNotRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"'
165+
assertFileNotRegex $hmEnvFile 'HYPRCURSOR_SIZE="32"'
166+
'';
167+
};
168+
};
49169
}

0 commit comments

Comments
 (0)