aboutsummaryrefslogtreecommitdiff
path: root/modules/services/transmission/default.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-13 14:17:00 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-13 14:17:00 -0700
commit9c467c91b7596d28bd7007017f9c1364dfb27278 (patch)
tree5049cfa4a13f3f54a038ecb371adef601d4cec52 /modules/services/transmission/default.nix
parentgrafana: correct domain name ... (diff)
downloadinfra-9c467c91b7596d28bd7007017f9c1364dfb27278.tar.gz
modules: make the vhost be configurable
Diffstat (limited to 'modules/services/transmission/default.nix')
-rw-r--r--modules/services/transmission/default.nix11
1 files changed, 8 insertions, 3 deletions
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;
};