mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
Move web-service-modules into a separate directory
This commit is contained in:
parent
52c510d612
commit
b2680db359
18 changed files with 0 additions and 0 deletions
36
modules/system/webServices/it-tools.nix
Normal file
36
modules/system/webServices/it-tools.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
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.tcp.list = [ cfg.port ];
|
||||
};
|
||||
|
||||
services.static-web-server = {
|
||||
enable = true;
|
||||
listen = "[::]:${toString cfg.port}";
|
||||
root = "${pkgs.it-tools}/lib";
|
||||
configuration.general.health = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue