nixos/services.foldingathome: remove with lib;

This commit is contained in:
Felix Buehler
2024-09-15 10:43:48 +02:00
committed by Jörg Thalheim
parent c37db9c3ee
commit af42ae4352
@@ -1,5 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.foldingathome;
@@ -11,19 +10,19 @@ let
in
{
imports = [
(mkRenamedOptionModule [ "services" "foldingAtHome" ] [ "services" "foldingathome" ])
(mkRenamedOptionModule [ "services" "foldingathome" "nickname" ] [ "services" "foldingathome" "user" ])
(mkRemovedOptionModule [ "services" "foldingathome" "config" ] ''
(lib.mkRenamedOptionModule [ "services" "foldingAtHome" ] [ "services" "foldingathome" ])
(lib.mkRenamedOptionModule [ "services" "foldingathome" "nickname" ] [ "services" "foldingathome" "user" ])
(lib.mkRemovedOptionModule [ "services" "foldingathome" "config" ] ''
Use <literal>services.foldingathome.extraArgs instead<literal>
'')
];
options.services.foldingathome = {
enable = mkEnableOption "Folding@home client";
enable = lib.mkEnableOption "Folding@home client";
package = mkPackageOption pkgs "fahclient" { };
package = lib.mkPackageOption pkgs "fahclient" { };
user = mkOption {
type = types.nullOr types.str;
user = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
The user associated with the reported computation results. This will
@@ -31,8 +30,8 @@ in
'';
};
team = mkOption {
type = types.int;
team = lib.mkOption {
type = lib.types.int;
default = 236565;
description = ''
The team ID associated with the reported computation results. This
@@ -42,8 +41,8 @@ in
'';
};
daemonNiceLevel = mkOption {
type = types.ints.between (-20) 19;
daemonNiceLevel = lib.mkOption {
type = lib.types.ints.between (-20) 19;
default = 0;
description = ''
Daemon process priority for FAHClient.
@@ -51,8 +50,8 @@ in
'';
};
extraArgs = mkOption {
type = types.listOf types.str;
extraArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = ''
Extra startup options for the FAHClient. Run
@@ -61,7 +60,7 @@ in
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.services.foldingathome = {
description = "Folding@home client";
after = [ "network.target" ];