diff options
Diffstat (limited to 'nixos/modules/services/system/uptimed.nix')
-rw-r--r-- | nixos/modules/services/system/uptimed.nix | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/nixos/modules/services/system/uptimed.nix b/nixos/modules/services/system/uptimed.nix index ab46c508914..5f8916bbf9a 100644 --- a/nixos/modules/services/system/uptimed.nix +++ b/nixos/modules/services/system/uptimed.nix @@ -45,23 +45,21 @@ in home = stateDir; }; - jobs.uptimed = - { description = "Uptimed daemon"; + systemd.services.uptimed = { + description = "Uptimed daemon"; + wantedBy = [ "multi-user.target" ]; - startOn = "startup"; + preStart = '' + mkdir -m 0755 -p ${stateDir} + chown ${uptimedUser} ${stateDir} - preStart = - '' - mkdir -m 0755 -p ${stateDir} - chown ${uptimedUser} ${stateDir} + if ! test -f ${stateDir}/bootid ; then + ${uptimed}/sbin/uptimed -b + fi + ''; - if ! test -f ${stateDir}/bootid ; then - ${uptimed}/sbin/uptimed -b - fi - ''; - - exec = "${uptimed}/sbin/uptimed"; - }; + script = "${uptimed}/sbin/uptimed"; + }; }; |