mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Add it-tools module
This commit is contained in:
parent
d2cc03be3b
commit
7319ee73d7
1 changed files with 39 additions and 0 deletions
39
modules/system/services/it-tools.nix
Normal file
39
modules/system/services/it-tools.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
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.ports.list = [ cfg.port ];
|
||||||
|
|
||||||
|
services.static-web-server = {
|
||||||
|
enable = true;
|
||||||
|
listen = "[::]:${toString cfg.port}";
|
||||||
|
root = "${pkgs.it-tools}/lib";
|
||||||
|
configuration.general.health = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
custom.services.gatus.endpoints."IT Tools" = {
|
||||||
|
group = "Public";
|
||||||
|
url = "https://${cfg.domain}/health";
|
||||||
|
extraConditions = [ "[BODY] == OK" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue