Add pretix extraDomains
This commit is contained in:
parent
95090e1a2b
commit
5c4740989e
2 changed files with 29 additions and 13 deletions
|
|
@ -4,6 +4,10 @@
|
|||
enable = true;
|
||||
instanceName = "Weinturm Open Air";
|
||||
domain = "tickets.weinturm-open-air.de";
|
||||
extraDomains = [
|
||||
"tickets.wasted-openair.de"
|
||||
"oel.wasted-openair.de"
|
||||
];
|
||||
enableTls = true;
|
||||
enableRegistration = false;
|
||||
passwordReset = true;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options.services.pretix = with lib; {
|
||||
options.services.pretix = with lib; with lib.types; {
|
||||
enable = mkEnableOption "Enable pretix ticket shop application";
|
||||
instanceName = mkOption {
|
||||
type = types.str;
|
||||
|
|
@ -74,7 +74,13 @@ in
|
|||
};
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
description = "The installation’s domain";
|
||||
description = "The installation’s main domain";
|
||||
example = "pretix.example.net";
|
||||
};
|
||||
extraDomains = mkOption {
|
||||
type = listOf str;
|
||||
description = "A list of extra domains";
|
||||
default = [ ];
|
||||
};
|
||||
enableTls = mkEnableOption "Whether to use TLS or not";
|
||||
enableRegistration = mkEnableOption "Enables or disables the registration of new admin users.";
|
||||
|
|
@ -124,17 +130,23 @@ in
|
|||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
virtualHosts."${cfg.domain}" = {
|
||||
enableACME = cfg.enableTls;
|
||||
forceSSL = cfg.enableTls;
|
||||
kTLS = cfg.enableTls;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${bind.host}:${toString bind.port}";
|
||||
};
|
||||
extraConfig = ''
|
||||
${hstsHeader}
|
||||
'';
|
||||
};
|
||||
virtualHosts = lib.listToAttrs (map
|
||||
(d: {
|
||||
name = d;
|
||||
value = {
|
||||
enableACME = cfg.enableTls;
|
||||
forceSSL = cfg.enableTls;
|
||||
kTLS = cfg.enableTls;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${bind.host}:${toString bind.port}";
|
||||
};
|
||||
extraConfig = ''
|
||||
${hstsHeader}
|
||||
'';
|
||||
};
|
||||
})
|
||||
([ cfg.domain ] ++ cfg.extraDomains)
|
||||
);
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue