diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-02-07 15:11:31 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-02-07 15:13:55 +0100 |
commit | 143a4afe5c239f46d632e6895a4615d79da85ac2 (patch) | |
tree | 983cb626a24297ffab74fa0f44e9c2ce32cab5df /modules/by-name | |
parent | hosts/server3/websites: Host nix-sync on server3 (diff) | |
download | nixos-server-143a4afe5c239f46d632e6895a4615d79da85ac2.zip |
modules/nix-sync: Correctly merge `extraSettings` and the needed vhost config
Diffstat (limited to 'modules/by-name')
-rw-r--r-- | modules/by-name/ni/nix-sync/module.nix | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/by-name/ni/nix-sync/module.nix b/modules/by-name/ni/nix-sync/module.nix index 1413920..9ddd210 100644 --- a/modules/by-name/ni/nix-sync/module.nix +++ b/modules/by-name/ni/nix-sync/module.nix @@ -2,6 +2,7 @@ config, lib, modulesPath, + nixLib, ... }: let cfg = config.vhack.nix-sync; @@ -27,12 +28,15 @@ }: { name = "${domain}"; value = - lib.recursiveUpdate { + # FIXME(@bpeetz): We cannot use something like `lib.recursiveUpdate` because the + # `extraSettings` are instantiated from the “real” nginx type. As such the + # `extaSettings` would override our values here. Therefore, the direct merge. <2025-02-07> + extraSettings + // { forceSSL = true; enableACME = true; root = "/etc/nginx/websites/${domain}"; - } - extraSettings; + }; }; virtHosts = builtins.listToAttrs (builtins.map mkVirtHost cfg.domains); in { @@ -66,7 +70,7 @@ in { type = lib.types.submodule (import (modulesPath + "/services/web-servers/nginx/vhost-options.nix") {inherit config lib;}); example = { - locations."/.well-known/openpgpkey/hu/".extraConfig = "default_type application/octet-stream"; + locations."/.well-known/openpgpkey/".extraConfig = "default_type application/octet-stream"; }; default = {}; description = '' |