From e593a4c094d5ddcd9e7bcd3b29d41a4d4a26f5e8 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Fri, 30 Aug 2024 00:46:46 +0200 Subject: [PATCH] nixos/services.sickbeard: remove `with lib;` --- nixos/modules/services/misc/sickbeard.nix | 37 +++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/nixos/modules/services/misc/sickbeard.nix b/nixos/modules/services/misc/sickbeard.nix index 51179fdb14d3..237abf7185a3 100644 --- a/nixos/modules/services/misc/sickbeard.nix +++ b/nixos/modules/services/misc/sickbeard.nix @@ -1,7 +1,4 @@ { config, lib, options, pkgs, ... }: - -with lib; - let name = "sickbeard"; @@ -17,41 +14,41 @@ in options = { services.sickbeard = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to enable the sickbeard server."; }; - package = mkPackageOption pkgs "sickbeard" { + package = lib.mkPackageOption pkgs "sickbeard" { example = "sickrage"; extraDescription = '' Enable `pkgs.sickrage` or `pkgs.sickgear` as an alternative to SickBeard ''; }; - dataDir = mkOption { - type = types.path; + dataDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/${name}"; description = "Path where to store data files."; }; - configFile = mkOption { - type = types.path; + configFile = lib.mkOption { + type = lib.types.path; default = "${cfg.dataDir}/config.ini"; - defaultText = literalExpression ''"''${config.${opt.dataDir}}/config.ini"''; + defaultText = lib.literalExpression ''"''${config.${opt.dataDir}}/config.ini"''; description = "Path to config file."; }; - port = mkOption { - type = types.ints.u16; + port = lib.mkOption { + type = lib.types.ints.u16; default = 8081; description = "Port to bind to."; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = name; description = "User to run the service as"; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = name; description = "Group to run the service as"; }; @@ -61,9 +58,9 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { - users.users = optionalAttrs (cfg.user == name) { + users.users = lib.optionalAttrs (cfg.user == name) { ${name} = { uid = config.ids.uids.sickbeard; group = cfg.group; @@ -73,7 +70,7 @@ in }; }; - users.groups = optionalAttrs (cfg.group == name) { + users.groups = lib.optionalAttrs (cfg.group == name) { ${name}.gid = config.ids.gids.sickbeard; };