sonarr runs in a vm now
This commit is contained in:
parent
b78c6df390
commit
110864d9d0
|
@ -1,40 +0,0 @@
|
||||||
{
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
nixpkgs.lib.extend (
|
|
||||||
_final: prev: let
|
|
||||||
inherit (prev) mkIf;
|
|
||||||
in {
|
|
||||||
extensions = {
|
|
||||||
createVm = {
|
|
||||||
name,
|
|
||||||
system ? nixpkgs.system,
|
|
||||||
}: config: {microvm, ...}: {
|
|
||||||
imports = [microvm.host];
|
|
||||||
microvm.hypervisor = "cloud-hypervisor";
|
|
||||||
microvm.vms.${name} = {
|
|
||||||
pkgs = import nixpkgs {inherit system;};
|
|
||||||
microvm.shares = [
|
|
||||||
{
|
|
||||||
tag = "ro-store";
|
|
||||||
source = "/nix/store";
|
|
||||||
mountPoint = "/nix/.ro-store";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
inherit config;
|
|
||||||
};
|
|
||||||
# Mount host /nix/store for drastically reduced image size and evaluation time
|
|
||||||
microvm.vms.${name}.config.shares = [
|
|
||||||
{
|
|
||||||
source = "/nix/store";
|
|
||||||
mountPoint = "/nix/.ro-store";
|
|
||||||
tag = "ro-store";
|
|
||||||
proto = "virtiofs";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
|
@ -55,7 +55,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.shoko-init = {
|
systemd.services.shoko-init = {
|
||||||
wantedeBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
# TODO: Check if shoko requires a db
|
# TODO: Check if shoko requires a db
|
||||||
# requires = optional haveLocalDB "postgresql.service";
|
# requires = optional haveLocalDB "postgresql.service";
|
||||||
# after = optional haveLocalDB "postgresql.service";
|
# after = optional haveLocalDB "postgresql.service";
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
{...}: let
|
{lib, ...}: let
|
||||||
host = "127.0.0.1";
|
host = "127.0.0.1";
|
||||||
port = 8989;
|
port = 8989;
|
||||||
in {
|
in {
|
||||||
microvm.autostart = ["sonarr"];
|
config.microvm.autostart = ["sonarr"];
|
||||||
microvm.vms."sonarr" = {
|
|
||||||
|
config.system.activationScripts.makeSonarrDir = lib.stringAfter ["var"] ''
|
||||||
|
mkdir -p /var/lib/sonarr
|
||||||
|
'';
|
||||||
|
|
||||||
|
config.microvm.vms."sonarr" = {
|
||||||
config = {
|
config = {
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
microvm.shares = [
|
microvm.shares = [
|
||||||
|
@ -18,6 +23,19 @@ in {
|
||||||
mountPoint = "/var/lib/sonarr";
|
mountPoint = "/var/lib/sonarr";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
microvm.interfaces = [
|
||||||
|
{
|
||||||
|
type = "tap";
|
||||||
|
|
||||||
|
# interface name on the host
|
||||||
|
id = "vm-sonarr";
|
||||||
|
|
||||||
|
# Ethernet address of the MicroVM's interface, not the host's
|
||||||
|
#
|
||||||
|
# Locally administered have one of 2/6/A/E in the second nibble.
|
||||||
|
mac = "02:00:00:00:00:01";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
services.sonarr = {
|
services.sonarr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
Loading…
Reference in a new issue