flake: add mediaserver-vm host for testing services from scratch
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
11f73e9e6a
commit
0235bc9875
3 changed files with 57 additions and 4 deletions
48
hosts/hardware/vm.nix
Normal file
48
hosts/hardware/vm.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#./hosts/hardware/vm.nix
|
||||
# Stand-in "hardware" for `nixos-rebuild build-vm --flake .#mediaserver-vm`.
|
||||
#
|
||||
# Keeps hostName = FredOS-Mediaserver so every hostname-gated module under
|
||||
# services/ switches on, but throws away the real disks, NICs and GPU. The
|
||||
# point is watching arr-interconnect wire a *fresh* stack from empty state —
|
||||
# something the live host can't demonstrate anymore, since its /var/lib is
|
||||
# already populated and the script is a reconciler, not an installer.
|
||||
{ lib, ... }:
|
||||
{
|
||||
networking.hostName = "FredOS-Mediaserver";
|
||||
system.stateVersion = "25.11";
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
# qemu-vm.nix supplies "/" and the bootloader. Only the media pool has to
|
||||
# exist by hand, so the *arr root folders resolve — contents are throwaway.
|
||||
fileSystems."/mnt/storage" = {
|
||||
device = "tmpfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "mode=0777" ];
|
||||
};
|
||||
|
||||
# --- Undo router.nix. This VM is not a router. ---
|
||||
# Its networkd units match NIC names pinned to the real MACs, so the VM's
|
||||
# NIC matches nothing and comes up unconfigured; its nft input chain is
|
||||
# policy-drop, which would eat the forwarded ports below. Scripted DHCP on
|
||||
# QEMU's user-mode NIC replaces both.
|
||||
networking.useNetworkd = lib.mkForce false;
|
||||
networking.nftables.tables = lib.mkForce { };
|
||||
services.dnsmasq.enable = lib.mkForce false;
|
||||
|
||||
virtualisation.vmVariant.virtualisation = {
|
||||
memorySize = 8192;
|
||||
cores = 4;
|
||||
diskSize = 32768; # docker images for shelfarr/profilarr are not small
|
||||
graphics = false; # serial console; ctrl-a x to quit
|
||||
forwardPorts = [
|
||||
{ from = "host"; host.port = 2222; guest.port = 22; }
|
||||
{ from = "host"; host.port = 8989; guest.port = 8989; } # sonarr
|
||||
{ from = "host"; host.port = 7878; guest.port = 7878; } # radarr
|
||||
{ from = "host"; host.port = 9696; guest.port = 9696; } # prowlarr
|
||||
{ from = "host"; host.port = 6767; guest.port = 6767; } # bazarr
|
||||
{ from = "host"; host.port = 8080; guest.port = 8080; } # qbittorrent
|
||||
{ from = "host"; host.port = 8096; guest.port = 8096; } # jellyfin
|
||||
{ from = "host"; host.port = 5055; guest.port = 5055; } # seerr
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue