diff --git a/nixos/modules/services/misc/nzbhydra2.nix b/nixos/modules/services/misc/nzbhydra2.nix index 8246ea52f978..c71e8a92b727 100644 --- a/nixos/modules/services/misc/nzbhydra2.nix +++ b/nixos/modules/services/misc/nzbhydra2.nix @@ -1,31 +1,28 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.nzbhydra2; in { options = { services.nzbhydra2 = { - enable = mkEnableOption "NZBHydra2, Usenet meta search"; + enable = lib.mkEnableOption "NZBHydra2, Usenet meta search"; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/nzbhydra2"; description = "The directory where NZBHydra2 stores its data files."; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = "Open ports in the firewall for the NZBHydra2 web interface."; }; - package = mkPackageOption pkgs "nzbhydra2" { }; + package = lib.mkPackageOption pkgs "nzbhydra2" { }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 0700 nzbhydra2 nzbhydra2 - -" ]; @@ -60,7 +57,7 @@ in { }; }; - networking.firewall = mkIf cfg.openFirewall { allowedTCPPorts = [ 5076 ]; }; + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ 5076 ]; }; users.users.nzbhydra2 = { group = "nzbhydra2";