summary refs log tree commit diff
path: root/nixos/modules/services/misc/folding-at-home.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/misc/folding-at-home.nix
parentaf50b03f50d88954e98018c7c18c0581928b7165 (diff)
downloadnixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar
nixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.gz
nixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.bz2
nixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.lz
nixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.xz
nixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.tar.zst
nixpkgs-88292fdf09960e9cb8e3c063a6b95ac4284222ec.zip
jobs -> systemd.services
Diffstat (limited to 'nixos/modules/services/misc/folding-at-home.nix')
-rw-r--r--nixos/modules/services/misc/folding-at-home.nix32
1 files changed, 13 insertions, 19 deletions
diff --git a/nixos/modules/services/misc/folding-at-home.nix b/nixos/modules/services/misc/folding-at-home.nix
index 392d2d1f002..4f09cbfdd79 100644
--- a/nixos/modules/services/misc/folding-at-home.nix
+++ b/nixos/modules/services/misc/folding-at-home.nix
@@ -49,26 +49,20 @@ in {
         home = stateDir;
       };
 
-    jobs.foldingAtHome =
-      { name = "foldingathome";
-
-        startOn = "started network-interfaces";
-        stopOn = "stopping network-interfaces";
-
-        preStart =
-          ''
-            mkdir -m 0755 -p ${stateDir}
-            chown ${fahUser} ${stateDir}
-            cp -f ${pkgs.writeText "client.cfg" cfg.config} ${stateDir}/client.cfg
-          '';
-        exec = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'";
-      };
-
-      services.foldingAtHome.config = ''
-          [settings]
-          username=${cfg.nickname}
+    systemd.services.foldingathome = {
+      after = [ "network-interfaces.target" ];
+      wantedBy = [ "multi-user.target" ];
+      preStart = ''
+        mkdir -m 0755 -p ${stateDir}
+        chown ${fahUser} ${stateDir}
+        cp -f ${pkgs.writeText "client.cfg" cfg.config} ${stateDir}/client.cfg
       '';
+      script = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'";
+    };
 
+    services.foldingAtHome.config = ''
+        [settings]
+        username=${cfg.nickname}
+    '';
   };
-
 }