From 67f60ebce88a89939fb509f304ac554bcdc5bfa6 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 18 Apr 2025 16:30:23 -0500 Subject: [PATCH] tests/home-cursor: don't use realPkgs --- tests/modules/config/home-cursor/default.nix | 40 ++++++++++--------- .../config/home-cursor/expected-index.theme | 3 -- 2 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 tests/modules/config/home-cursor/expected-index.theme diff --git a/tests/modules/config/home-cursor/default.nix b/tests/modules/config/home-cursor/default.nix index 3e5f2019..2b4e680d 100644 --- a/tests/modules/config/home-cursor/default.nix +++ b/tests/modules/config/home-cursor/default.nix @@ -1,12 +1,20 @@ +let + package = { + buildScript = '' + mkdir -p $out/share/icons/catppuccin-macchiato-blue-cursors + echo test > $out/share/icons/catppuccin-macchiato-blue-cursors/index.theme + ''; + }; +in { # Ensure backwards compatibility with existing configs home-cursor-legacy = - { realPkgs, ... }: + { config, ... }: { config = { home.pointerCursor = { - package = realPkgs.catppuccin-cursors.macchiatoBlue; name = "catppuccin-macchiato-blue-standard"; + package = config.lib.test.mkStubPackage package; size = 64; gtk.enable = true; hyprcursor.enable = true; @@ -16,9 +24,7 @@ home.stateVersion = "24.11"; nmt.script = '' - assertFileContent \ - home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \ - ${./expected-index.theme} + assertFileExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh assertFileExists $hmEnvFile @@ -61,12 +67,12 @@ }; home-cursor-legacy-disabled-with-enable = - { realPkgs, ... }: + { config, ... }: { config = { home.pointerCursor = { enable = false; - package = realPkgs.catppuccin-cursors.macchiatoBlue; + package = config.lib.test.mkStubPackage package; name = "catppuccin-macchiato-blue-standard"; size = 64; gtk.enable = true; @@ -90,12 +96,12 @@ }; home-cursor-legacy-enabled-with-enable = - { realPkgs, ... }: + { config, ... }: { config = { home.pointerCursor = { enable = true; - package = realPkgs.catppuccin-cursors.macchiatoBlue; + package = config.lib.test.mkStubPackage package; name = "catppuccin-macchiato-blue-standard"; size = 64; gtk.enable = true; @@ -106,9 +112,7 @@ home.stateVersion = "24.11"; nmt.script = '' - assertFileContent \ - home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \ - ${./expected-index.theme} + assertFileExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh assertFileExists $hmEnvFile @@ -122,12 +126,12 @@ }; home-cursor = - { realPkgs, ... }: + { config, ... }: { config = { home.pointerCursor = { enable = true; - package = realPkgs.catppuccin-cursors.macchiatoBlue; + package = config.lib.test.mkStubPackage package; name = "catppuccin-macchiato-blue-standard"; size = 64; gtk.enable = true; @@ -138,9 +142,7 @@ home.stateVersion = "25.05"; nmt.script = '' - assertFileContent \ - home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme \ - ${./expected-index.theme} + assertFileExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh assertFileExists $hmEnvFile @@ -153,12 +155,12 @@ }; home-cursor-disabled = - { realPkgs, ... }: + { config, ... }: { config = { home.pointerCursor = { enable = false; - package = realPkgs.catppuccin-cursors.macchiatoBlue; + package = config.lib.test.mkStubPackage package; name = "catppuccin-macchiato-blue-standard"; size = 64; gtk.enable = true; diff --git a/tests/modules/config/home-cursor/expected-index.theme b/tests/modules/config/home-cursor/expected-index.theme deleted file mode 100644 index 7ce17e0b..00000000 --- a/tests/modules/config/home-cursor/expected-index.theme +++ /dev/null @@ -1,3 +0,0 @@ -[Icon Theme] -Name=Catppuccin Macchiato Blue -Comment=based on Volantes Cursors