summary refs log tree commit diff
path: root/nixos/modules/services/scheduling/fcron.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/scheduling/fcron.nix')
-rw-r--r--nixos/modules/services/scheduling/fcron.nix38
1 files changed, 17 insertions, 21 deletions
diff --git a/nixos/modules/services/scheduling/fcron.nix b/nixos/modules/services/scheduling/fcron.nix
index ade8c19329c..7b4665a8204 100644
--- a/nixos/modules/services/scheduling/fcron.nix
+++ b/nixos/modules/services/scheduling/fcron.nix
@@ -108,29 +108,25 @@ in
 
     security.setuidPrograms = [ "fcrontab" ];
 
-    jobs.fcron =
-      { description = "fcron daemon";
-
-        startOn = "startup";
-
-        after = [ "local-fs.target" ];
-
-        environment =
-          { PATH = "/run/current-system/sw/bin";
-          };
-
-        preStart =
-          ''
-            ${pkgs.coreutils}/bin/mkdir -m 0700 -p /var/spool/fcron
-            # load system crontab file
-            ${pkgs.fcron}/bin/fcrontab -u systab ${pkgs.writeText "systab" cfg.systab}
-          '';
+    systemd.services.fcron = {
+      description = "fcron daemon";
+      after = [ "local-fs.target" ];
+      wantedBy = [ "multi-user.target" ];
+
+      # FIXME use specific path
+      environment = {
+        PATH = "/run/current-system/sw/bin";
+      };
 
-        daemonType = "fork";
+      preStart = ''
+        ${pkgs.coreutils}/bin/mkdir -m 0700 -p /var/spool/fcron
+        # load system crontab file
+        ${pkgs.fcron}/bin/fcrontab -u systab ${pkgs.writeText "systab" cfg.systab}
+      '';
 
-        exec = "${pkgs.fcron}/sbin/fcron -m ${toString cfg.maxSerialJobs} ${queuelen}";
-      };
+      serviceConfig.Type = "forking";
 
+      script = "${pkgs.fcron}/sbin/fcron -m ${toString cfg.maxSerialJobs} ${queuelen}";
+    };
   };
-
 }