mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
36 lines
660 B
Nix
36 lines
660 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.custom.services.it-tools;
|
|
in
|
|
{
|
|
options.custom.services.it-tools = {
|
|
enable = lib.mkEnableOption "";
|
|
domain = lib.mkOption {
|
|
type = lib.types.nonEmptyStr;
|
|
default = "";
|
|
};
|
|
port = lib.mkOption {
|
|
type = lib.types.port;
|
|
default = 8787;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
meta = {
|
|
domains.list = [ cfg.domain ];
|
|
ports.list = [ cfg.port ];
|
|
};
|
|
|
|
services.static-web-server = {
|
|
enable = true;
|
|
listen = "[::]:${toString cfg.port}";
|
|
root = "${pkgs.it-tools}/lib";
|
|
configuration.general.health = true;
|
|
};
|
|
};
|
|
}
|