aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/systemd/timers.nix
blob: 1c0e272229935279321b21f912c4112e178d98ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    systemd.user.timers.test-timer = {
      Unit = { Description = "A basic test timer"; };

      Timer = { OnUnitActiveSec = "1h 30m"; };

      Install = { WantedBy = [ "timers.target" ]; };
    };

    nmt.script = ''
      unitDir=home-files/.config/systemd/user
      timerFile=$unitDir/test-timer.timer

      assertFileExists $timerFile
      assertFileContent $timerFile ${./timers-expected.conf}

      assertFileExists $unitDir/timers.target.wants/test-timer.timer
    '';
  };
}