summary refs log tree commit diff
path: root/nixos/modules/services/security
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/security
parentaf50b03f50d88954e98018c7c18c0581928b7165 (diff)
downloadnixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar
nixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.gz
nixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.bz2
nixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.lz
nixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.xz
nixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.zst
nixlib-88292fdf09960e9cb8e3c063a6b95ac4284222ec.zip
jobs -> systemd.services
Diffstat (limited to 'nixos/modules/services/security')
-rw-r--r--nixos/modules/services/security/fprot.nix32
1 files changed, 15 insertions, 17 deletions
diff --git a/nixos/modules/services/security/fprot.nix b/nixos/modules/services/security/fprot.nix
index 7270a9f98145..a12aa01503e3 100644
--- a/nixos/modules/services/security/fprot.nix
+++ b/nixos/modules/services/security/fprot.nix
@@ -67,24 +67,22 @@ in {
 
     services.cron.systemCronJobs = [ "*/${toString cfg.updater.frequency} * * * * root start fprot-updater" ];
 
-    jobs = {
-      fprot_updater = {
-        name = "fprot-updater";
-          task = true;
-
-          # have to copy fpupdate executable because it insists on storing the virus database in the same dir
-          preStart = ''
-            mkdir -m 0755 -p ${stateDir}
-            chown ${fprotUser}:${fprotGroup} ${stateDir}
-            cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir}
-            ln -sf ${cfg.updater.productData} ${stateDir}/product.data
-          '';
-          #setuid = fprotUser;
-          #setgid = fprotGroup;
-          exec = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}";
+    systemd.services."fprot-updater" = {
+      serviceConfig = {
+        Type = "oneshot";
+        RemainAfterExit = false;
       };
-    };
+      wantedBy = [ "multi-user.target" ];
 
- };
+      # have to copy fpupdate executable because it insists on storing the virus database in the same dir
+      preStart = ''
+        mkdir -m 0755 -p ${stateDir}
+        chown ${fprotUser}:${fprotGroup} ${stateDir}
+        cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir}
+        ln -sf ${cfg.updater.productData} ${stateDir}/product.data
+      '';
 
+      script = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}";
+    };
+ };
 }