aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/services/system/uptimed.nix
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-01-06 06:50:18 +0000
committerRobin Gloster <mail@glob.in>2016-01-07 06:39:06 +0000
commit88292fdf09960e9cb8e3c063a6b95ac4284222ec (patch)
tree34ff267ed7bacf9fd906b1736476b431e9afe909 /nixos/modules/services/system/uptimed.nix
parentaf50b03f50d88954e98018c7c18c0581928b7165 (diff)
jobs -> systemd.services
Diffstat (limited to 'nixos/modules/services/system/uptimed.nix')
-rw-r--r--nixos/modules/services/system/uptimed.nix26
1 files changed, 12 insertions, 14 deletions
diff --git a/nixos/modules/services/system/uptimed.nix b/nixos/modules/services/system/uptimed.nix
index ab46c508914d..5f8916bbf9a4 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";
+ };
};