feat: add (but disable for now) uptime kuma module for 'hecuba'
This commit is contained in:
@@ -17,6 +17,7 @@ in
|
|||||||
./hard.nix
|
./hard.nix
|
||||||
../../modules/ssh/hardened-openssh.nix
|
../../modules/ssh/hardened-openssh.nix
|
||||||
../../modules/docker
|
../../modules/docker
|
||||||
|
../../modules/uptime-kuma
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = hostName;
|
networking.hostName = hostName;
|
||||||
@@ -31,6 +32,8 @@ in
|
|||||||
|
|
||||||
docker.user = username;
|
docker.user = username;
|
||||||
|
|
||||||
|
my.uptime-kuma.enable = false;
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
|||||||
39
modules/uptime-kuma/default.nix
Normal file
39
modules/uptime-kuma/default.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.my.uptime-kuma;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.uptime-kuma.enable = lib.mkEnableOption "Uptime Kuma monitoring service (Docker container)";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
virtualisation.oci-containers = {
|
||||||
|
backend = "docker";
|
||||||
|
containers.uptime-kuma = {
|
||||||
|
image = "louislam/uptime-kuma:latest";
|
||||||
|
ports = [ "127.0.0.1:3001:3001" ];
|
||||||
|
volumes = [ "/var/lib/uptime-kuma:/app/data" ];
|
||||||
|
environment = {
|
||||||
|
TZ = "UTC";
|
||||||
|
UMASK = "0022";
|
||||||
|
};
|
||||||
|
extraOptions = [
|
||||||
|
"--network=proxiable"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.settings."uptime-kuma" = {
|
||||||
|
"/var/lib/uptime-kuma".d = {
|
||||||
|
mode = "0755";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ docker-compose ];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user