From 74f2ed6a64a087fadb39a4af84c5ecc8083b686d Mon Sep 17 00:00:00 2001 From: isabel Date: Wed, 19 Feb 2025 22:35:36 +0000 Subject: [PATCH] test/home-cursor: add new .enable check --- tests/modules/config/home-cursor/default.nix | 120 +++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/tests/modules/config/home-cursor/default.nix b/tests/modules/config/home-cursor/default.nix index 08cde5452..f27e2a44d 100644 --- a/tests/modules/config/home-cursor/default.nix +++ b/tests/modules/config/home-cursor/default.nix @@ -32,6 +32,40 @@ config = { home.pointerCursor = null; + home.stateVersion = "25.05"; + + test.asserts.warnings.expected = ['' + Setting home.pointerCursor to null is deprecated. + Please update your configuration so that + + home.pointerCursor.enable = false; + '']; + + nmt.script = '' + assertPathNotExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme + + hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh + assertFileExists $hmEnvFile + assertFileNotRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileNotRegex $hmEnvFile 'XCURSOR_SIZE="32"' + assertFileNotRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileNotRegex $hmEnvFile 'HYPRCURSOR_SIZE="32"' + ''; + }; + }; + + home-cursor-legacy-disabled-with-enable = { realPkgs, ... }: { + config = { + home.pointerCursor = { + enable = false; + package = realPkgs.catppuccin-cursors.macchiatoBlue; + name = "catppuccin-macchiato-blue-standard"; + size = 64; + gtk.enable = true; + hyprcursor.enable = true; + x11.enable = true; + }; + home.stateVersion = "24.11"; nmt.script = '' @@ -46,4 +80,90 @@ ''; }; }; + + home-cursor-legacy-enabled-with-enable = { realPkgs, ... }: { + config = { + home.pointerCursor = { + enable = true; + package = realPkgs.catppuccin-cursors.macchiatoBlue; + name = "catppuccin-macchiato-blue-standard"; + size = 64; + gtk.enable = true; + hyprcursor.enable = true; + x11.enable = true; + }; + + home.stateVersion = "24.11"; + + nmt.script = '' + assertFileContent \ + home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \ + ${./expected-index.theme} + + hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh + assertFileExists $hmEnvFile + assertFileRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileRegex $hmEnvFile 'XCURSOR_SIZE="64"' + assertFileRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileRegex $hmEnvFile 'HYPRCURSOR_SIZE="64"' + ''; + + }; + }; + + home-cursor = { realPkgs, ... }: { + config = { + home.pointerCursor = { + enable = true; + package = realPkgs.catppuccin-cursors.macchiatoBlue; + name = "catppuccin-macchiato-blue-standard"; + size = 64; + gtk.enable = true; + hyprcursor.enable = true; + x11.enable = true; + }; + + home.stateVersion = "25.05"; + + nmt.script = '' + assertFileContent \ + home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \ + ${./expected-index.theme} + + hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh + assertFileExists $hmEnvFile + assertFileRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileRegex $hmEnvFile 'XCURSOR_SIZE="64"' + assertFileRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileRegex $hmEnvFile 'HYPRCURSOR_SIZE="64"' + ''; + }; + }; + + home-cursor-disabled = { realPkgs, ... }: { + config = { + home.pointerCursor = { + enable = false; + package = realPkgs.catppuccin-cursors.macchiatoBlue; + name = "catppuccin-macchiato-blue-standard"; + size = 64; + gtk.enable = true; + hyprcursor.enable = true; + x11.enable = true; + }; + + home.stateVersion = "25.05"; + + nmt.script = '' + assertPathNotExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme + + hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh + assertFileExists $hmEnvFile + assertFileNotRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileNotRegex $hmEnvFile 'XCURSOR_SIZE="32"' + assertFileNotRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileNotRegex $hmEnvFile 'HYPRCURSOR_SIZE="32"' + ''; + }; + }; }