diff options
author | zimbatm <zimbatm@zimbatm.com> | 2020-03-09 23:07:37 +0100 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2020-03-14 13:01:26 -0700 |
commit | 001be890f78f04df86938f44c0761676e299ceac (patch) | |
tree | aa189b0d35ea6e5733e2c95d2e4e2377c11bcb07 /nixos/modules/services/misc | |
parent | b6fe12b1cc699376eb8cb9281362215290be8a90 (diff) | |
download | nixlib-001be890f78f04df86938f44c0761676e299ceac.tar nixlib-001be890f78f04df86938f44c0761676e299ceac.tar.gz nixlib-001be890f78f04df86938f44c0761676e299ceac.tar.bz2 nixlib-001be890f78f04df86938f44c0761676e299ceac.tar.lz nixlib-001be890f78f04df86938f44c0761676e299ceac.tar.xz nixlib-001be890f78f04df86938f44c0761676e299ceac.tar.zst nixlib-001be890f78f04df86938f44c0761676e299ceac.zip |
folding@home: 6.02 -> 7.5.1
The v7 series is very different. This commit introduces the 3 packages: fahclient, fahcontrol and fahviewer. It also rebuilds the NixOS module to map better with the new client.
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r-- | nixos/modules/services/misc/folding-at-home.nix | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/nixos/modules/services/misc/folding-at-home.nix b/nixos/modules/services/misc/folding-at-home.nix deleted file mode 100644 index fd2ea3948f64..000000000000 --- a/nixos/modules/services/misc/folding-at-home.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; -let - stateDir = "/var/lib/foldingathome"; - cfg = config.services.foldingAtHome; - fahUser = "foldingathome"; -in { - - ###### interface - - options = { - - services.foldingAtHome = { - - enable = mkOption { - default = false; - description = '' - Whether to enable the Folding@Home to use idle CPU time. - ''; - }; - - nickname = mkOption { - default = "Anonymous"; - description = '' - A unique handle for statistics. - ''; - }; - - config = mkOption { - default = ""; - description = '' - Extra configuration. Contents will be added verbatim to the - configuration file. - ''; - }; - - }; - - }; - - ###### implementation - - config = mkIf cfg.enable { - - users.users.${fahUser} = - { uid = config.ids.uids.foldingathome; - description = "Folding@Home user"; - home = stateDir; - }; - - systemd.services.foldingathome = { - after = [ "network.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.runtimeShell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'"; - }; - - services.foldingAtHome.config = '' - [settings] - username=${cfg.nickname} - ''; - }; -} |