Compare commits

..

No commits in common. "pixelfed-on-metal-2" and "main" have entirely different histories.

2 changed files with 16 additions and 30 deletions

View file

@ -14,7 +14,6 @@ let
inherit (builtins) toString;
inherit (lib) types mkOption mkEnableOption optionalString concatStringsSep;
inherit (lib.strings) escapeShellArg;
inherit (lib.attrsets) filterAttrs mapAttrs';
cfg = config.services.garage;
fedicfg = config.fediversity.internal.garage;
concatMapAttrs = scriptFn: attrset: concatStringsSep "\n" (lib.mapAttrsToList scriptFn attrset);
@ -160,13 +159,10 @@ in
};
};
## Create a proxy from <bucket>.web.garage.<domain> to localhost:3902 for
## each bucket that has `website = true`.
services.nginx.virtualHosts =
let
value = {
services.nginx.virtualHosts.${fedicfg.web.rootDomain} = {
forceSSL = true;
enableACME = true;
serverAliases = lib.mapAttrsToList (bucket: _: fedicfg.web.domainForBucket bucket) cfg.ensureBuckets; ## TODO: use wildcard certificates?
locations."/" = {
proxyPass = "http://localhost:3902";
extraConfig = ''
@ -174,9 +170,6 @@ in
'';
};
};
in mapAttrs'
(bucket: _: {name = fedicfg.web.domainForBucket bucket; inherit value;})
(filterAttrs (_: {website, ...}: website) cfg.ensureBuckets);
systemd.services.ensure-garage = {
after = [ "garage.service" ];

View file

@ -1,24 +1,17 @@
{ lib, config, modulesPath, ... }:
let
inherit (lib) mkVMOverride mapAttrs' filterAttrs;
cfg = config.services.garage;
inherit (lib) mkVMOverride;
fedicfg = config.fediversity.internal.garage;
in {
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
services.nginx.virtualHosts =
let
value = {
services.nginx.virtualHosts.${fedicfg.web.rootDomain} = {
forceSSL = mkVMOverride false;
enableACME = mkVMOverride false;
};
in mapAttrs'
(bucket: _: {name = fedicfg.web.domainForBucket bucket; inherit value;})
(filterAttrs (_: {website, ...}: website) cfg.ensureBuckets);
virtualisation.diskSize = 2048;
virtualisation.forwardPorts = [