manual-website/module.nix
2023-10-23 10:12:21 +02:00

29 lines
642 B
Nix

{ lib, pkgs, config, ... }:
let
cfg = config.services.ese-manual;
in
{
options.services.kpp = {
enable = mkEnableOption "ese-manual";
hostName = mkOption {
type = types.nullOr types.str;
default = null;
example = "manual.example.com";
description = ''
The hostname the application should be served on.
If it is `null`, nginx will not be automatically configured.
'';
};
};
config = lib.mkIf cfg.enable {
services.nginx = lib.mkIf (cfg.hostName != null) {
enable = true;
virtualHosts.${cfg.hostName} = {
root = pkgs.ese-manual;
};
};
};
}