From 9c467c91b7596d28bd7007017f9c1364dfb27278 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 13 Apr 2022 14:17:00 -0700 Subject: modules: make the vhost be configurable --- modules/services/transmission/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'modules/services/transmission/default.nix') diff --git a/modules/services/transmission/default.nix b/modules/services/transmission/default.nix index dea7828..57bea77 100644 --- a/modules/services/transmission/default.nix +++ b/modules/services/transmission/default.nix @@ -5,6 +5,11 @@ let in { options.my.services.transmission = with lib; { enable = mkEnableOption "transmission torrent server"; + vhostName = mkOption { + type = types.str; + example = "music.fcuny.net"; + description = "Name for the virtual host"; + }; }; config = lib.mkIf cfg.enable { @@ -27,16 +32,16 @@ in { }; }; - services.nginx.virtualHosts."bt.fcuny.xyz" = { + services.nginx.virtualHosts."${cfg.vhostName}" = { forceSSL = true; - useACMEHost = "bt.fcuny.xyz"; + useACMEHost = cfg.vhostName; locations."/" = { proxyPass = "http://127.0.0.1:9091"; proxyWebsockets = true; }; }; - security.acme.certs."bt.fcuny.xyz" = { + security.acme.certs."${cfg.vhostName}" = { dnsProvider = "gcloud"; credentialsFile = secrets."acme/credentials".path; }; -- cgit 1.4.1