41 lines
840 B
Nix
41 lines
840 B
Nix
{
|
|
inputs,
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.suites.senfnvp;
|
|
in
|
|
{
|
|
options.suites.senfnvp.website.enable = lib.mkOption {
|
|
type = with lib.types; uniq bool;
|
|
default = true;
|
|
description = "Enable senfnvp Website (kb-one.de)";
|
|
};
|
|
options.suites.senfnvp.website.httpPort = lib.mkOption {
|
|
type = with lib.types; port;
|
|
default = 8080;
|
|
description = "Website HTTP Port";
|
|
};
|
|
|
|
config = lib.mkIf (cfg.enable && cfg.website.enable) {
|
|
containers.website = {
|
|
autoStart = true;
|
|
config = {
|
|
services.nginx.enable = true;
|
|
services.nginx.virtualHosts."${cfg.hostname}" = {
|
|
root = "/var/www/${cfg.hostname}";
|
|
listen = [{
|
|
addr = "127.0.0.1";
|
|
port = cfg.website.httpPort;
|
|
}];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
|