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/website.nix
./services/mailserver.nix ./services/mailserver.nix
./services/fail2ban.nix ./services/fail2ban.nix
./services/sonarr.nix
./services/misc.nix ./services/misc.nix
./modules/git.nix ./modules/git.nix

View file

@ -8,11 +8,10 @@ nixpkgs.lib.extend (
inherit (prev) mkIf; inherit (prev) mkIf;
in { in {
extensions = { extensions = {
createvm = { createVm = {
name, name,
system ? nixpkgs.system, system ? nixpkgs.system,
config, }: config: {microvm, ...}: {
}: {microvm, ...}: {
imports = [microvm.host]; imports = [microvm.host];
microvm.hypervisor = "cloud-hypervisor"; microvm.hypervisor = "cloud-hypervisor";
microvm.vms.${name} = { microvm.vms.${name} = {

View file

@ -1,7 +1,9 @@
{...}: let {lib, ...}: let
host = "127.0.0.1"; host = "127.0.0.1";
port = 8989; port = 8989;
in { in {
imports = [
(lib.extensions.createVm {name = "Sonarr VM";} {
services.sonarr = { services.sonarr = {
enable = true; enable = true;
openFirewall = false; # Hide sonarr behind firewall openFirewall = false; # Hide sonarr behind firewall
@ -14,4 +16,6 @@ in {
proxyPass = "http://${host}:${toString port}"; proxyPass = "http://${host}:${toString port}";
}; };
}; };
})
];
} }