2024-09-24 14:55:20 +02:00
|
|
|
{ lib, config, modulesPath, ... }:
|
2024-09-24 14:40:35 +02:00
|
|
|
|
|
|
|
let
|
2024-10-01 23:08:09 +02:00
|
|
|
inherit (lib) mkVMOverride mapAttrs' filterAttrs;
|
|
|
|
|
|
|
|
cfg = config.services.garage;
|
2024-09-24 14:55:20 +02:00
|
|
|
|
2024-09-24 14:40:35 +02:00
|
|
|
fedicfg = config.fediversity.internal.garage;
|
|
|
|
|
|
|
|
in {
|
2024-10-01 10:02:01 +02:00
|
|
|
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
|
2024-09-24 14:40:35 +02:00
|
|
|
|
2024-10-01 23:08:09 +02:00
|
|
|
services.nginx.virtualHosts =
|
|
|
|
let
|
|
|
|
value = {
|
|
|
|
forceSSL = mkVMOverride false;
|
|
|
|
enableACME = mkVMOverride false;
|
|
|
|
};
|
|
|
|
in mapAttrs'
|
|
|
|
(bucket: _: {name = fedicfg.web.domainForBucket bucket; inherit value;})
|
|
|
|
(filterAttrs (_: {website, ...}: website) cfg.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 = fedicfg.rpc.port;
|
|
|
|
guest.port = fedicfg.rpc.port;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
from = "host";
|
2024-09-24 14:42:18 +02:00
|
|
|
host.port = fedicfg.web.internalPort;
|
|
|
|
guest.port = fedicfg.web.internalPort;
|
2024-09-24 14:40:35 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|