diff --git a/tests/modules/services/hyprsunset/basic-configuration.nix b/tests/modules/services/hyprsunset/basic-configuration.nix index fbb520933..96837d276 100644 --- a/tests/modules/services/hyprsunset/basic-configuration.nix +++ b/tests/modules/services/hyprsunset/basic-configuration.nix @@ -3,45 +3,28 @@ enable = true; extraArgs = [ "--identity" ]; - transitions = { - sunrise = { - calendar = "*-*-* 06:30:00"; - requests = [ - [ "temperature 6500" ] - [ "identity" ] - ]; - }; + settings = { + max-gamma = 150; - sunset = { - calendar = "*-*-* 19:30:00"; - requests = [ [ "temperature 3500" ] ]; - }; + profile = [ + { + time = "7:30"; + identity = true; + } + { + time = "21:00"; + temperature = 5000; + gamma = 0.8; + } + ]; }; }; nmt.script = '' - # Check that the main service exists + config=home-files/.config/hypr/hyprsunset.conf mainService=home-files/.config/systemd/user/hyprsunset.service + assertFileExists $config assertFileExists $mainService - - # Check that the transition services exist - sunriseService=home-files/.config/systemd/user/hyprsunset-sunrise.service - sunsetService=home-files/.config/systemd/user/hyprsunset-sunset.service - assertFileExists $sunriseService - assertFileExists $sunsetService - - # Check that the timers exist - sunriseTimer=home-files/.config/systemd/user/hyprsunset-sunrise.timer - sunsetTimer=home-files/.config/systemd/user/hyprsunset-sunset.timer - assertFileExists $sunriseTimer - assertFileExists $sunsetTimer - - # Verify timer configurations - assertFileContains $sunriseTimer "OnCalendar=*-*-* 06:30:00" - assertFileContains $sunsetTimer "OnCalendar=*-*-* 19:30:00" - - # Verify service configurations - assertFileContains $sunriseService "ExecStart=@hyprland@/bin/hyprctl hyprsunset 'temperature 6500' && @hyprland@/bin/hyprctl hyprsunset identity" - assertFileContains $sunsetService "ExecStart=@hyprland@/bin/hyprctl hyprsunset 'temperature 3500'" + assertFileContent $config ${./hyprsunset.conf} ''; } diff --git a/tests/modules/services/hyprsunset/default.nix b/tests/modules/services/hyprsunset/default.nix index c6ee370dc..a416782d0 100644 --- a/tests/modules/services/hyprsunset/default.nix +++ b/tests/modules/services/hyprsunset/default.nix @@ -2,4 +2,5 @@ lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { hyprsunset-basic-configuration = ./basic-configuration.nix; + hyprsunset-no-configuration = ./no-configuration.nix; } diff --git a/tests/modules/services/hyprsunset/hyprsunset.conf b/tests/modules/services/hyprsunset/hyprsunset.conf new file mode 100644 index 000000000..a84cd29e0 --- /dev/null +++ b/tests/modules/services/hyprsunset/hyprsunset.conf @@ -0,0 +1,11 @@ +profile { + identity=true + time=7:30 +} + +profile { + gamma=0.800000 + temperature=5000 + time=21:00 +} +max-gamma=150 diff --git a/tests/modules/services/hyprsunset/no-configuration.nix b/tests/modules/services/hyprsunset/no-configuration.nix new file mode 100644 index 000000000..172033588 --- /dev/null +++ b/tests/modules/services/hyprsunset/no-configuration.nix @@ -0,0 +1,10 @@ +{ + services.hyprsunset.enable = true; + + nmt.script = '' + config=home-files/.config/hypr/hyprsunset.conf + clientServiceFile=home-files/.config/systemd/user/hyprsunset.service + assertPathNotExists $config + assertFileExists $clientServiceFile + ''; +}