about summary refs log tree commit diff
path: root/nixos/modules/services/misc/bazarr.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/misc/bazarr.nix')
-rw-r--r--nixos/modules/services/misc/bazarr.nix29
1 files changed, 13 insertions, 16 deletions
diff --git a/nixos/modules/services/misc/bazarr.nix b/nixos/modules/services/misc/bazarr.nix
index 99343a146a7a..e81b5d2b736e 100644
--- a/nixos/modules/services/misc/bazarr.nix
+++ b/nixos/modules/services/misc/bazarr.nix
@@ -1,42 +1,39 @@
 { config, pkgs, lib, ... }:
-
-with lib;
-
 let
   cfg = config.services.bazarr;
 in
 {
   options = {
     services.bazarr = {
-      enable = mkEnableOption "bazarr, a subtitle manager for Sonarr and Radarr";
+      enable = lib.mkEnableOption "bazarr, a subtitle manager for Sonarr and Radarr";
 
-      openFirewall = mkOption {
-        type = types.bool;
+      openFirewall = lib.mkOption {
+        type = lib.types.bool;
         default = false;
         description = "Open ports in the firewall for the bazarr web interface.";
       };
 
-      listenPort = mkOption {
-        type = types.port;
+      listenPort = lib.mkOption {
+        type = lib.types.port;
         default = 6767;
         description = "Port on which the bazarr web interface should listen";
       };
 
-      user = mkOption {
-        type = types.str;
+      user = lib.mkOption {
+        type = lib.types.str;
         default = "bazarr";
         description = "User account under which bazarr runs.";
       };
 
-      group = mkOption {
-        type = types.str;
+      group = lib.mkOption {
+        type = lib.types.str;
         default = "bazarr";
         description = "Group under which bazarr runs.";
       };
     };
   };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     systemd.services.bazarr = {
       description = "bazarr";
       after = [ "network.target" ];
@@ -58,11 +55,11 @@ in
       };
     };
 
-    networking.firewall = mkIf cfg.openFirewall {
+    networking.firewall = lib.mkIf cfg.openFirewall {
       allowedTCPPorts = [ cfg.listenPort ];
     };
 
-    users.users = mkIf (cfg.user == "bazarr") {
+    users.users = lib.mkIf (cfg.user == "bazarr") {
       bazarr = {
         isSystemUser = true;
         group = cfg.group;
@@ -70,7 +67,7 @@ in
       };
     };
 
-    users.groups = mkIf (cfg.group == "bazarr") {
+    users.groups = lib.mkIf (cfg.group == "bazarr") {
       bazarr = {};
     };
   };