home-manager/tests/modules/systemd/timers.nix

22 lines
475 B
Nix
Raw Normal View History

2023-05-12 22:08:12 +00:00
{ ... }:
2019-03-24 14:52:30 +00:00
{
2023-05-12 22:08:12 +00:00
systemd.user.timers.test-timer = {
Unit = { Description = "A basic test timer"; };
2019-03-24 14:52:30 +00:00
2023-05-12 22:08:12 +00:00
Timer = { OnUnitActiveSec = "1h 30m"; };
2019-03-24 14:52:30 +00:00
2023-05-12 22:08:12 +00:00
Install = { WantedBy = [ "timers.target" ]; };
};
2019-03-24 14:52:30 +00:00
2023-05-12 22:08:12 +00:00
nmt.script = ''
unitDir=home-files/.config/systemd/user
timerFile=$unitDir/test-timer.timer
2019-03-24 14:52:30 +00:00
2023-05-12 22:08:12 +00:00
assertFileExists $timerFile
assertFileContent $timerFile ${./timers-expected.conf}
2019-03-24 14:52:30 +00:00
2023-05-12 22:08:12 +00:00
assertFileExists $unitDir/timers.target.wants/test-timer.timer
'';
2019-03-24 14:52:30 +00:00
}