2024-05-20 20:52:57 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-06-24 11:38:28 -04:00
|
|
|
cfg = config.aux.system.services.boinc;
|
2024-05-20 20:52:57 -04:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
2024-09-14 16:05:10 -04:00
|
|
|
aux.system.services.boinc = {
|
|
|
|
enable = lib.mkEnableOption "Enables BOINC distributed computing service.";
|
|
|
|
home = lib.mkOption {
|
|
|
|
default = "/var/lib/boinc";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Where to store BOINC's files";
|
|
|
|
};
|
|
|
|
};
|
2024-05-20 20:52:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.boinc = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.boinc-headless;
|
2024-09-14 16:05:10 -04:00
|
|
|
dataDir = cfg.home;
|
2024-07-08 12:52:07 -04:00
|
|
|
extraEnvPackages = [
|
|
|
|
pkgs.ocl-icd
|
|
|
|
] ++ lib.optionals config.aux.system.gpu.nvidia.enable [ pkgs.linuxPackages.nvidia_x11 ];
|
2024-05-26 20:04:43 -04:00
|
|
|
allowRemoteGuiRpc = true;
|
2024-05-20 20:52:57 -04:00
|
|
|
};
|
2024-05-26 20:04:43 -04:00
|
|
|
|
2024-09-17 10:42:09 -04:00
|
|
|
systemd.services.boinc.unitConfig.RequiresMountsFor = cfg.home;
|
|
|
|
|
2024-05-26 20:04:43 -04:00
|
|
|
# Allow connections via BOINC Manager
|
|
|
|
networking.firewall.allowedTCPPorts = [ 31416 ];
|
2024-05-20 20:52:57 -04:00
|
|
|
};
|
|
|
|
}
|