1
0
Fork 0
nix-configuration/modules/nixos/services/boinc/default.nix

41 lines
902 B
Nix
Raw Permalink Normal View History

2024-05-21 00:52:57 +00:00
{
config,
lib,
pkgs,
2024-12-06 16:46:10 +00:00
namespace,
2024-05-21 00:52:57 +00:00
...
}:
let
2024-12-06 16:46:10 +00:00
cfg = config.${namespace}.services.boinc;
2024-05-21 00:52:57 +00:00
in
{
options = {
2024-12-06 16:46:10 +00:00
${namespace}.services.boinc = {
2024-09-14 20:05:10 +00:00
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-21 00:52:57 +00:00
};
config = lib.mkIf cfg.enable {
services.boinc = {
enable = true;
package = pkgs.boinc-headless;
2024-09-14 20:05:10 +00:00
dataDir = cfg.home;
extraEnvPackages = [
pkgs.ocl-icd
2024-12-06 16:46:10 +00:00
] ++ lib.optionals config.${namespace}.gpu.nvidia.enable [ pkgs.linuxPackages.nvidia_x11 ];
2024-05-27 00:04:43 +00:00
allowRemoteGuiRpc = true;
2024-05-21 00:52:57 +00:00
};
2024-05-27 00:04:43 +00:00
systemd.services.boinc.unitConfig.RequiresMountsFor = cfg.home;
2024-05-27 00:04:43 +00:00
# Allow connections via BOINC Manager
networking.firewall.allowedTCPPorts = [ 31416 ];
2024-05-21 00:52:57 +00:00
};
}