about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFelix Buehler2024-08-24 22:05:52 +0200
committerFelix Buehler2024-08-30 23:00:55 +0200
commiteddc7384dbe02a08b85c6651ad485aa430312f81 (patch)
treec2cc144cf1fbfe130fc6c60ea794add143e0c5b9 /nixos
parentd40cf96f750d38568991d807e1b76480e2fecc92 (diff)
nixos/services.ombi: remove `with lib;`
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/ombi.nix33
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 = { }; };
   };
 }