placed sonarr in a vm

This commit is contained in:
Snorre 2025-03-04 13:53:05 +01:00
parent f3c5706763
commit 6bbccc4f5a
3 changed files with 19 additions and 15 deletions

View file

@ -8,6 +8,7 @@
./services/website.nix
./services/mailserver.nix
./services/fail2ban.nix
./services/sonarr.nix
./services/misc.nix
./modules/git.nix

View file

@ -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} = {

View file

@ -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}";
};
};
})
];
}