mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
networking-toolbox: Init module
This commit is contained in:
parent
cfa3792d93
commit
9677ce5f19
1 changed files with 27 additions and 0 deletions
27
modules/system/web-services/networking-toolbox.nix
Normal file
27
modules/system/web-services/networking-toolbox.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.web-services.networking-toolbox;
|
||||
in
|
||||
{
|
||||
options.custom.web-services.networking-toolbox = {
|
||||
enable = lib.mkEnableOption "";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 4479;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers.networking-toolbox = {
|
||||
image = "lissy93/networking-toolbox";
|
||||
ports = [ "127.0.0.1:${toString cfg.port}:3000" ];
|
||||
pull = "newer";
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue