2024-08-24 21:26:38 +03:00
|
|
|
{ abs, config, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
secrets = import (abs "lib/secrets.nix");
|
|
|
|
|
|
|
|
UID = 1100;
|
|
|
|
in {
|
|
|
|
# we use cf tunnels because 443 port is used by the proxy,
|
2024-08-30 11:34:22 +03:00
|
|
|
# and it's also generally easierbrew install cloudflared &&
|
|
|
|
|
2024-08-24 21:26:38 +03:00
|
|
|
imports = [
|
|
|
|
(secrets.declare [{
|
2024-08-30 11:34:22 +03:00
|
|
|
name = "arumi-cf-token";
|
2024-08-24 21:26:38 +03:00
|
|
|
owner = "uptime-kuma";
|
|
|
|
}])
|
|
|
|
];
|
|
|
|
|
|
|
|
users.users.uptime-kuma = {
|
|
|
|
isNormalUser = true;
|
|
|
|
uid = UID;
|
|
|
|
};
|
|
|
|
users.groups.uptime-kuma = {};
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers.uptime-kuma = {
|
|
|
|
image = "louislam/uptime-kuma:1.23.13-debian";
|
|
|
|
volumes = [
|
|
|
|
"/srv/uptime-kuma:/app/data"
|
|
|
|
];
|
|
|
|
environment = {
|
|
|
|
PUID = builtins.toString UID;
|
|
|
|
PGID = builtins.toString UID;
|
|
|
|
};
|
|
|
|
environmentFiles = [
|
2024-08-30 11:34:22 +03:00
|
|
|
(secrets.file config "arumi-cf-token")
|
2024-08-24 21:26:38 +03:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"d /srv/uptime-kuma 0700 ${builtins.toString UID} ${builtins.toString UID} -"
|
|
|
|
];
|
|
|
|
}
|