0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

nixos/services.nzbhydra2: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-24 22:05:51 +02:00
parent 2da17447da
commit a99bf84530

View file

@ -1,31 +1,28 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib;
let cfg = config.services.nzbhydra2; let cfg = config.services.nzbhydra2;
in { in {
options = { options = {
services.nzbhydra2 = { services.nzbhydra2 = {
enable = mkEnableOption "NZBHydra2, Usenet meta search"; enable = lib.mkEnableOption "NZBHydra2, Usenet meta search";
dataDir = mkOption { dataDir = lib.mkOption {
type = types.str; type = lib.types.str;
default = "/var/lib/nzbhydra2"; default = "/var/lib/nzbhydra2";
description = "The directory where NZBHydra2 stores its data files."; description = "The directory where NZBHydra2 stores its data files.";
}; };
openFirewall = mkOption { openFirewall = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = "Open ports in the firewall for the NZBHydra2 web interface."; 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 = systemd.tmpfiles.rules =
[ "d '${cfg.dataDir}' 0700 nzbhydra2 nzbhydra2 - -" ]; [ "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 = { users.users.nzbhydra2 = {
group = "nzbhydra2"; group = "nzbhydra2";