about summary refs log tree commit diff
path: root/modules/piracy/sonarr.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/piracy/sonarr.nix')
-rw-r--r--modules/piracy/sonarr.nix17
1 files changed, 7 insertions, 10 deletions
diff --git a/modules/piracy/sonarr.nix b/modules/piracy/sonarr.nix
index 8715a12..0761a3d 100644
--- a/modules/piracy/sonarr.nix
+++ b/modules/piracy/sonarr.nix
@@ -6,7 +6,6 @@
   this,
   ...
 }:
-with lib;
 let
   cfg = config.nixfiles.modules.piracy.sonarr;
 
@@ -14,16 +13,16 @@ let
 in
 {
   options.nixfiles.modules.piracy.sonarr = {
-    enable = mkEnableOption "Sonarr";
+    enable = lib.mkEnableOption "Sonarr";
 
-    domain = mkOption {
+    domain = lib.mkOption {
       description = "Domain name sans protocol scheme.";
-      type = with types; str;
+      type = lib.types.str;
       default = "sonarr.${config.networking.domain}";
     };
   };
 
-  config = mkIf cfg.enable {
+  config = lib.mkIf cfg.enable {
     secrets.sonarr-api-key.file = "${inputs.self}/secrets/sonarr-api-key";
 
     ark.directories = [ "/var/lib/sonarr" ];
@@ -74,11 +73,9 @@ in
       ];
     };
 
-    topology = with cfg; {
-      nodes.${this.hostname}.services.sonarr = {
-        info = domain;
-        details.listen.text = "127.0.0.1:${toString port}";
-      };
+    topology.nodes.${this.hostname}.services.sonarr = {
+      info = cfg.domain;
+      details.listen.text = "127.0.0.1:${toString port}";
     };
   };
 }

Consider giving Nix/NixOS a try! <3