diff options
Diffstat (limited to 'nixos/modules/services/misc/ombi.nix')
-rw-r--r-- | nixos/modules/services/misc/ombi.nix | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/nixos/modules/services/misc/ombi.nix b/nixos/modules/services/misc/ombi.nix index 9b2e3cf84e5d..51f3c3e468a5 100644 --- a/nixos/modules/services/misc/ombi.nix +++ b/nixos/modules/services/misc/ombi.nix @@ -1,13 +1,10 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.ombi; in { options = { services.ombi = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' Ombi, a web application that automatically gives your shared Plex or Emby users the ability to request content by themselves! @@ -15,39 +12,39 @@ in { on how to set up a reverse proxy ''; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/ombi"; description = "The directory where Ombi stores its data files."; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 5000; description = "The port for the Ombi web interface."; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = "Open ports in the firewall for the Ombi web interface."; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "ombi"; description = "User account under which Ombi runs."; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "ombi"; description = "Group under which Ombi runs."; }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -" ]; @@ -66,11 +63,11 @@ in { }; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; }; - users.users = mkIf (cfg.user == "ombi") { + users.users = lib.mkIf (cfg.user == "ombi") { ombi = { isSystemUser = true; group = cfg.group; @@ -78,6 +75,6 @@ in { }; }; - users.groups = mkIf (cfg.group == "ombi") { ombi = { }; }; + users.groups = lib.mkIf (cfg.group == "ombi") { ombi = { }; }; }; } |