Last active
August 5, 2018 13:13
-
-
Save symphorien/cc0187bee47a05c71e0199a06b877763 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
with lib; | |
{ | |
options.mine.simple-timer.enable = mkEnableOption "simple-timer"; | |
config = mkIf config.mine.simple-timer.enable { | |
systemd = { | |
timers.simple-timer = { | |
wantedBy = [ "timers.target" ]; | |
partOf = [ "simple-timer.service" ]; | |
timerConfig.OnCalendar = "minutely"; | |
}; | |
services.simple-timer = { | |
serviceConfig.Type = "oneshot"; | |
serviceConfig.Umask = "0022"; | |
script = '' | |
echo "Time: $(date)." >> /tmp/simple-timer.log | |
''; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment