Fediversity/services/vm/garage-vm.nix

41 lines
952 B
Nix
Raw Normal View History

2024-11-11 17:25:42 +01:00
{
lib,
config,
modulesPath,
...
}:
2024-09-24 14:40:35 +02:00
let
2024-10-01 17:08:09 -04:00
inherit (lib) mkVMOverride mapAttrs' filterAttrs;
2024-11-11 17:25:42 +01:00
in
{
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
2024-09-24 14:40:35 +02:00
2024-10-01 17:08:09 -04:00
services.nginx.virtualHosts =
let
value = {
forceSSL = mkVMOverride false;
enableACME = mkVMOverride false;
};
2024-11-11 17:25:42 +01:00
in
mapAttrs' (bucket: _: {
name = config.fediversity.internal.garage.web.domainForBucket bucket;
2024-11-11 17:25:42 +01:00
inherit value;
}) (filterAttrs (_: { website, ... }: website) config.fediversity.garage.ensureBuckets);
2024-09-24 14:55:20 +02:00
2024-09-24 14:40:35 +02:00
virtualisation.diskSize = 2048;
virtualisation.forwardPorts = [
{
from = "host";
host.port = config.fediversity.internal.garage.rpc.port;
guest.port = config.fediversity.internal.garage.rpc.port;
2024-09-24 14:40:35 +02:00
}
{
from = "host";
host.port = config.fediversity.internal.garage.web.internalPort;
guest.port = config.fediversity.internal.garage.web.internalPort;
2024-09-24 14:40:35 +02:00
}
];
}