modules: services: use new nginx wrapper
All checks were successful
continuous-integration/drone/push Build is passing

And when not possible, document why.

Note for the future: there is some repetition in some modules to
configure the correct value of the subdomain, which I happen to know
will line up correctly thanks to the nginx wrapper. A good way to
refactor this in the future would involve avoiding this repetition,
allowing use to query the correct domain in some way...
This commit is contained in:
Bruno BELANYI 2021-08-24 23:05:10 +02:00
parent 81e12969eb
commit 7032ddef37
19 changed files with 187 additions and 254 deletions

View file

@ -2,8 +2,6 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.nextcloud;
domain = config.networking.domain;
nextcloudDomain = "nextcloud.${config.networking.domain}";
in
{
options.my.services.nextcloud = with lib; {
@ -31,7 +29,7 @@ in
services.nextcloud = {
enable = true;
package = pkgs.nextcloud22;
hostName = nextcloudDomain;
hostName = "nextcloud.${config.networking.domain}";
home = "/var/lib/nextcloud";
maxUploadSize = cfg.maxSize;
config = {
@ -59,11 +57,10 @@ in
after = [ "postgresql.service" ];
};
services.nginx.virtualHosts."${nextcloudDomain}" = {
# The service above configures the domain, no need for my wrapper
services.nginx.virtualHosts."nextcloud.${config.networking.domain}" = {
forceSSL = true;
useACMEHost = domain;
locations."/".proxyPass = "http://127.0.0.1:3000/";
useACMEHost = config.networking.domain;
};
my.services.backup = {