Make tegola domain name configurable by environment
This commit is contained in:
parent
f9fee85606
commit
a61f904098
3 changed files with 15 additions and 3 deletions
|
|
@ -2,14 +2,20 @@
|
|||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.myModules.tegola;
|
||||
databaseName = "tegola";
|
||||
databaseUser = "tegola";
|
||||
domainName = "tegola.nidus.cloud";
|
||||
port = 9090;
|
||||
group = "tegola";
|
||||
user = "tegola";
|
||||
in {
|
||||
options.myModules.tegola.enable = mkEnableOption "custom tegola configuration";
|
||||
options.myModules.tegola = {
|
||||
domainName = mkOption {
|
||||
example = "tegola.nidus.cloud";
|
||||
type = types.str;
|
||||
};
|
||||
enable = mkEnableOption "custom tegola configuration";
|
||||
};
|
||||
|
||||
config = mkIf config.myModules.tegola.enable {
|
||||
environment = {
|
||||
|
|
@ -23,7 +29,7 @@ in {
|
|||
];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 9090 ];
|
||||
services.caddy.virtualHosts."${domainName}" = {
|
||||
services.caddy.virtualHosts."${cfg.domainName}" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy {
|
||||
to http://127.0.0.1:${toString port}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue