Add beszel module
This commit is contained in:
parent
d4cc7f893e
commit
5c9999132b
2 changed files with 64 additions and 0 deletions
58
modules/beszel-hub.nix
Normal file
58
modules/beszel-hub.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
||||
cfg = config.services.beszel-docker;
|
||||
version = "0.18.7";
|
||||
|
||||
in {
|
||||
|
||||
options.services.beszel-docker = {
|
||||
enable = lib.mkEnableOption "Beszel hub hosted as OCI container";
|
||||
appUrl = lib.mkOption {
|
||||
description = "URL of the beszel hub";
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers = {
|
||||
beszel = {
|
||||
image = "henrygd/beszel:${version}";
|
||||
autoStart = true;
|
||||
networks = [
|
||||
"traefik"
|
||||
];
|
||||
environment = {
|
||||
APP_URL = cfg.appUrl;
|
||||
};
|
||||
extraOptions = [
|
||||
''--mount=type=volume,source=data,target=/beszel_data,volume-driver=local''
|
||||
/*''--health-cmd=["/beszel" "health" "--url" "http://localhost:8090"]''
|
||||
"--health-interval=120s"
|
||||
"--health-timeout=5s"
|
||||
"--health-retries=2"
|
||||
"--health-start-period=10s"*/
|
||||
];
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.http.routers.beszel.rule" = "Host(`${lib.removePrefix "https://" cfg.appUrl}`)";
|
||||
"traefik.http.routers.beszel.entrypoints" = "websecure";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."docker-beszel" = {
|
||||
after = [
|
||||
"docker-traefik.service"
|
||||
];
|
||||
requires = [
|
||||
"docker-traefik.service"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue