nixos/services.boinc: remove with lib;

This commit is contained in:
Felix Buehler
2024-08-28 21:18:56 +02:00
committed by Jörg Thalheim
parent 400d31aeb5
commit c37db9c3ee

View File

@@ -1,10 +1,7 @@
{config, lib, pkgs, ...}: {config, lib, pkgs, ...}:
with lib;
let let
cfg = config.services.boinc; cfg = config.services.boinc;
allowRemoteGuiRpcFlag = optionalString cfg.allowRemoteGuiRpc "--allow_remote_gui_rpc"; allowRemoteGuiRpcFlag = lib.optionalString cfg.allowRemoteGuiRpc "--allow_remote_gui_rpc";
fhsEnv = pkgs.buildFHSEnv { fhsEnv = pkgs.buildFHSEnv {
name = "boinc-fhs-env"; name = "boinc-fhs-env";
@@ -16,8 +13,8 @@ let
in in
{ {
options.services.boinc = { options.services.boinc = {
enable = mkOption { enable = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = '' description = ''
Whether to enable the BOINC distributed computing client. If this Whether to enable the BOINC distributed computing client. If this
@@ -27,20 +24,20 @@ in
''; '';
}; };
package = mkPackageOption pkgs "boinc" { package = lib.mkPackageOption pkgs "boinc" {
example = "boinc-headless"; example = "boinc-headless";
}; };
dataDir = mkOption { dataDir = lib.mkOption {
type = types.path; type = lib.types.path;
default = "/var/lib/boinc"; default = "/var/lib/boinc";
description = '' description = ''
The directory in which to store BOINC's configuration and data files. The directory in which to store BOINC's configuration and data files.
''; '';
}; };
allowRemoteGuiRpc = mkOption { allowRemoteGuiRpc = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = '' description = ''
If set to true, any remote host can connect to and control this BOINC If set to true, any remote host can connect to and control this BOINC
@@ -52,10 +49,10 @@ in
''; '';
}; };
extraEnvPackages = mkOption { extraEnvPackages = lib.mkOption {
type = types.listOf types.package; type = lib.types.listOf lib.types.package;
default = []; default = [];
example = literalExpression "[ pkgs.virtualbox ]"; example = lib.literalExpression "[ pkgs.virtualbox ]";
description = '' description = ''
Additional packages to make available in the environment in which Additional packages to make available in the environment in which
BOINC will run. Common choices are: BOINC will run. Common choices are:
@@ -77,7 +74,7 @@ in
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [cfg.package]; environment.systemPackages = [cfg.package];
users.users.boinc = { users.users.boinc = {