Fediversity/services/vm/garage-vm.nix
Kiara Grouwstra c296bdab0a
deploy separate operator applications thru data model
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
2025-11-22 17:55:10 +01:00

44 lines
965 B
Nix

{
lib,
config,
modulesPath,
...
}:
let
inherit (lib) mkVMOverride mapAttrs' filterAttrs;
in
{
_class = "nixos";
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
fediversity.garage.enable = true;
services.nginx.virtualHosts =
let
value = {
forceSSL = mkVMOverride false;
enableACME = mkVMOverride false;
};
in
mapAttrs' (bucket: _: {
name = config.fediversity.garage.web.domainForBucket bucket;
inherit value;
}) (filterAttrs (_: { website, ... }: website) config.fediversity.garage.ensureBuckets);
virtualisation.diskSize = 2048;
virtualisation.forwardPorts = [
{
from = "host";
host.port = config.fediversity.garage.rpc.port;
guest.port = config.fediversity.garage.rpc.port;
}
{
from = "host";
host.port = config.fediversity.garage.web.internalPort;
guest.port = config.fediversity.garage.web.internalPort;
}
];
}