Skip to content

Instantly share code, notes, and snippets.

@symphorien
Last active August 5, 2018 13:13
Show Gist options
  • Save symphorien/cc0187bee47a05c71e0199a06b877763 to your computer and use it in GitHub Desktop.
Save symphorien/cc0187bee47a05c71e0199a06b877763 to your computer and use it in GitHub Desktop.
{ 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