mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/services.nzbhydra2: remove with lib;
This commit is contained in:
parent
2da17447da
commit
a99bf84530
1 changed files with 8 additions and 11 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue