diff --git a/tests/modules/services/window-managers/hyprland/hyprland-stubs.nix b/tests/modules/services/window-managers/hyprland/hyprland-stubs.nix new file mode 100644 index 00000000..02d1885b --- /dev/null +++ b/tests/modules/services/window-managers/hyprland/hyprland-stubs.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: { + # Avoid unnecessary downloads in CI jobs and/or make out paths constant, i.e., + # not containing hashes, version numbers etc. + test.stubs = { + xdg-desktop-portal = { }; + xwayland = { }; + }; + + nixpkgs.overlays = [ + (_final: _prev: { + dbus = config.lib.test.mkStubPackage { name = "dbus"; }; + hyprland = lib.makeOverridable + (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; + xdg-desktop-portal-hyprland = lib.makeOverridable (_: + config.lib.test.mkStubPackage { name = "xdg-desktop-portal-hyprland"; }) + { }; + systemd = + lib.makeOverridable (_attrs: config.lib.test.mkStubPackage { }) { }; + }) + ]; +} diff --git a/tests/modules/services/window-managers/hyprland/inconsistent-config.nix b/tests/modules/services/window-managers/hyprland/inconsistent-config.nix index 0f9a18e5..c475d9c8 100644 --- a/tests/modules/services/window-managers/hyprland/inconsistent-config.nix +++ b/tests/modules/services/window-managers/hyprland/inconsistent-config.nix @@ -1,10 +1,6 @@ -{ config, lib, ... }: - -{ +{ config, ... }: { wayland.windowManager.hyprland = { enable = true; - package = lib.makeOverridable - (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; plugins = [ "/path/to/plugin1" (config.lib.test.mkStubPackage { name = "foo"; }) ]; }; diff --git a/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix b/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix index 86d60c63..40f92a91 100644 --- a/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix +++ b/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix @@ -1,10 +1,8 @@ -{ config, lib, ... }: +{ config, ... }: { + imports = [ ./hyprland-stubs.nix ]; -{ wayland.windowManager.hyprland = { enable = true; - package = lib.makeOverridable - (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; plugins = [ "/path/to/plugin1" (config.lib.test.mkStubPackage { name = "foo"; }) ]; settings = { diff --git a/tests/modules/services/window-managers/hyprland/null-all-packages-config.nix b/tests/modules/services/window-managers/hyprland/null-all-packages-config.nix index 1aeb4c39..c27bff01 100644 --- a/tests/modules/services/window-managers/hyprland/null-all-packages-config.nix +++ b/tests/modules/services/window-managers/hyprland/null-all-packages-config.nix @@ -1,4 +1,6 @@ { ... }: { + imports = [ ./hyprland-stubs.nix ]; + wayland.windowManager.hyprland = { enable = true; package = null; diff --git a/tests/modules/services/window-managers/hyprland/null-package-config.nix b/tests/modules/services/window-managers/hyprland/null-package-config.nix index 5c0dda44..463cbd53 100644 --- a/tests/modules/services/window-managers/hyprland/null-package-config.nix +++ b/tests/modules/services/window-managers/hyprland/null-package-config.nix @@ -1,4 +1,6 @@ -{ ... }: { +{ + imports = [ ./hyprland-stubs.nix ]; + wayland.windowManager.hyprland = { enable = true; package = null; diff --git a/tests/modules/services/window-managers/hyprland/null-portal-package-config.nix b/tests/modules/services/window-managers/hyprland/null-portal-package-config.nix index 3b2b2a94..c118e23e 100644 --- a/tests/modules/services/window-managers/hyprland/null-portal-package-config.nix +++ b/tests/modules/services/window-managers/hyprland/null-portal-package-config.nix @@ -1,6 +1,9 @@ -{ ... }: { +{ + imports = [ ./hyprland-stubs.nix ]; + wayland.windowManager.hyprland = { enable = true; + portalPackage = null; settings = { diff --git a/tests/modules/services/window-managers/hyprland/simple-config.nix b/tests/modules/services/window-managers/hyprland/simple-config.nix index e7b11ffe..5feaffe0 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.nix +++ b/tests/modules/services/window-managers/hyprland/simple-config.nix @@ -1,10 +1,8 @@ -{ config, lib, ... }: +{ config, ... }: { + imports = [ ./hyprland-stubs.nix ]; -{ wayland.windowManager.hyprland = { enable = true; - package = lib.makeOverridable - (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; plugins = [ "/path/to/plugin1" (config.lib.test.mkStubPackage { name = "foo"; }) ]; settings = { diff --git a/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix b/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix index 4161cd75..005c7bc4 100644 --- a/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix +++ b/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix @@ -1,10 +1,8 @@ -{ config, lib, ... }: - { + imports = [ ./hyprland-stubs.nix ]; + wayland.windowManager.hyprland = { enable = true; - package = lib.makeOverridable - (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; settings = { source = [ "sourced.conf" ];