diff --git a/configuration.nix b/configuration.nix index 4d794be..776b487 100755 --- a/configuration.nix +++ b/configuration.nix @@ -8,6 +8,7 @@ ./services/website.nix ./services/mailserver.nix ./services/fail2ban.nix + ./services/sonarr.nix ./services/misc.nix ./modules/git.nix diff --git a/lib/default.nix b/lib/default.nix index 77e66cc..96e9b2e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -8,11 +8,10 @@ nixpkgs.lib.extend ( inherit (prev) mkIf; in { extensions = { - createvm = { + createVm = { name, system ? nixpkgs.system, - config, - }: {microvm, ...}: { + }: config: {microvm, ...}: { imports = [microvm.host]; microvm.hypervisor = "cloud-hypervisor"; microvm.vms.${name} = { diff --git a/services/sonarr.nix b/services/sonarr.nix index 26a81e2..4810676 100644 --- a/services/sonarr.nix +++ b/services/sonarr.nix @@ -1,17 +1,21 @@ -{...}: let +{lib, ...}: let host = "127.0.0.1"; port = 8989; in { - services.sonarr = { - enable = true; - openFirewall = false; # Hide sonarr behind firewall - }; + imports = [ + (lib.extensions.createVm {name = "Sonarr VM";} { + services.sonarr = { + enable = true; + openFirewall = false; # Hide sonarr behind firewall + }; - services.nginx.virtualHosts."git.spoodythe.one" = { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}"; - }; - }; + services.nginx.virtualHosts."git.spoodythe.one" = { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}"; + }; + }; + }) + ]; }