From b7a4bc063fb6b26064c1f626aa3bd1b3960c85b5 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 25 Dec 2023 19:28:53 +0100 Subject: [PATCH] nixos: services: nginx: add default subdomain In almost all cases, the subdomain should be the same as the attribute name... --- modules/nixos/services/nginx/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/nixos/services/nginx/default.nix b/modules/nixos/services/nginx/default.nix index 53c947b..e916c9c 100644 --- a/modules/nixos/services/nginx/default.nix +++ b/modules/nixos/services/nginx/default.nix @@ -5,10 +5,11 @@ let domain = config.networking.domain; - virtualHostOption = with lib; types.submodule { + virtualHostOption = with lib; types.submodule ({ name, ... }: { options = { subdomain = mkOption { type = types.str; + default = name; example = "dev"; description = '' Which subdomain, under config.networking.domain, to use @@ -72,7 +73,7 @@ let ''; }; }; - }; + }); in { imports = [ @@ -106,11 +107,9 @@ in port = 8080; }; dev = { - subdomain = "dev"; root = "/var/www/dev"; }; jellyfin = { - subdomain = "jellyfin"; port = 8096; extraConfig = { locations."/socket" = {