about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFelix Buehler2024-08-24 22:05:38 +0200
committerFelix Buehler2024-08-30 23:00:13 +0200
commitb8142ce7cafe5eca9c0a4fd2c07457c4a1d4f9f1 (patch)
treed8a311c5be84f59f298cdc10ed4c478407021087 /nixos
parent686be24d1b45a5937e30362b4970e062204621d2 (diff)
nixos/services.bazarr: remove `with lib;`
Diffstat (limited to 'nixos')
-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 = {};
     };
   };