2019-03-24 15:52:30 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
systemd.user.timers.test-timer = {
|
2020-02-02 00:39:17 +01:00
|
|
|
Unit = { Description = "A basic test timer"; };
|
2019-03-24 15:52:30 +01:00
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Timer = { OnUnitActiveSec = "1h 30m"; };
|
2019-03-24 15:52:30 +01:00
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "timers.target" ]; };
|
2019-03-24 15:52:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nmt.script = ''
|
2020-04-10 00:25:21 +02:00
|
|
|
unitDir=home-files/.config/systemd/user
|
|
|
|
timerFile=$unitDir/test-timer.timer
|
2019-03-24 15:52:30 +01:00
|
|
|
|
|
|
|
assertFileExists $timerFile
|
|
|
|
assertFileContent $timerFile ${./timers-expected.conf}
|
|
|
|
|
|
|
|
assertFileExists $unitDir/timers.target.wants/test-timer.timer
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|