diff options
author | Felix Buehler | 2024-08-24 22:05:47 +0200 |
---|---|---|
committer | Felix Buehler | 2024-08-30 23:00:52 +0200 |
commit | d562492115ae547ce54e7ec0f1222f5e1fc0dfa9 (patch) | |
tree | 433c260e9304cb975d562ae3f815b94f4aafeff7 /nixos | |
parent | 4e1b387f248f60ee43c0806f962b36027744b71f (diff) |
nixos/services.lidarr: remove `with lib;`
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/misc/lidarr.nix | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/nixos/modules/services/misc/lidarr.nix b/nixos/modules/services/misc/lidarr.nix index 5f7b5c293a25..fd94f6536b22 100644 --- a/nixos/modules/services/misc/lidarr.nix +++ b/nixos/modules/services/misc/lidarr.nix @@ -1,41 +1,38 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.lidarr; in { options = { services.lidarr = { - enable = mkEnableOption "Lidarr, a Usenet/BitTorrent music downloader"; + enable = lib.mkEnableOption "Lidarr, a Usenet/BitTorrent music downloader"; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/lidarr/.config/Lidarr"; description = "The directory where Lidarr stores its data files."; }; - package = mkPackageOption pkgs "lidarr" { }; + package = lib.mkPackageOption pkgs "lidarr" { }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Open ports in the firewall for Lidarr ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "lidarr"; description = '' User account under which Lidarr runs. ''; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "lidarr"; description = '' Group under which Lidarr runs. @@ -44,7 +41,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.tmpfiles.settings."10-lidarr".${cfg.dataDir}.d = { inherit (cfg) user group; mode = "0700"; @@ -64,11 +61,11 @@ in }; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ 8686 ]; }; - users.users = mkIf (cfg.user == "lidarr") { + users.users = lib.mkIf (cfg.user == "lidarr") { lidarr = { group = cfg.group; home = "/var/lib/lidarr"; @@ -76,7 +73,7 @@ in }; }; - users.groups = mkIf (cfg.group == "lidarr") { + users.groups = lib.mkIf (cfg.group == "lidarr") { lidarr = { gid = config.ids.gids.lidarr; }; |