From 641a62305305692c294ab3f67c597bc90067a667 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 18 May 2018 18:24:53 +0200 Subject: nixos/xss-lock: add module (#40619) `xsslock` (which was originally packaged in 6cb1d1aaaf02a72329bedf9c6960e54fea6f5c6e) is a simple screensaver which connects a given screen locker (e.g. `i3lock`) with `logind`. Whenever `loginctl lock-sessions` is invoked the locker will be used to lock the screen. This works with its power management features (e.g. `lid switch`) as well, so the PC can be locked automatically when the lid is closed. The module can be used like this: ``` { services.xserver.enable = true; programs.xss-lock.enable = true; programs.xss-lock.lockerCommand = "i3lock"; } ``` --- nixos/tests/xss-lock.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 nixos/tests/xss-lock.nix (limited to 'nixos/tests') diff --git a/nixos/tests/xss-lock.nix b/nixos/tests/xss-lock.nix new file mode 100644 index 00000000000..3e3864cab77 --- /dev/null +++ b/nixos/tests/xss-lock.nix @@ -0,0 +1,25 @@ +import ./make-test.nix ({ pkgs, lib, ... }: + +with lib; + +{ + name = "xss-lock"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ma27 ]; + + machine = { + imports = [ ./common/x11.nix ./common/user-account.nix ]; + programs.xss-lock.enable = true; + programs.xss-lock.lockerCommand = "${pkgs.xlockmore}/bin/xlock"; + services.xserver.displayManager.auto.user = "alice"; + }; + + testScript = '' + $machine->start; + $machine->waitForX; + $machine->waitForUnit("xss-lock.service", "alice"); + + $machine->fail("pgrep xlock"); + $machine->succeed("su -l alice -c 'xset dpms force standby'"); + $machine->succeed("pgrep xlock"); + ''; +}) -- cgit 1.4.1 From e3a7d55d3e6bf6243fafcd102ccb886bdb495a1b Mon Sep 17 00:00:00 2001 From: Robert Schütz Date: Fri, 18 May 2018 23:06:25 +0200 Subject: nixos/tests/home-assistant: ignore "Timer got out of sync" error (#40735) --- nixos/tests/home-assistant.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nixos/tests') diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix index 3d920dccc16..797706a062c 100644 --- a/nixos/tests/home-assistant.nix +++ b/nixos/tests/home-assistant.nix @@ -71,6 +71,7 @@ in { print "$log\n"; # Check that no errors were logged - $hass->fail("cat ${configDir}/home-assistant.log | grep -qF ERROR"); + # The timer can get out of sync due to Hydra's load, so this error is ignored + $hass->fail("cat ${configDir}/home-assistant.log | grep -vF 'Timer got out of sync' | grep -qF ERROR"); ''; }) -- cgit 1.4.1