mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
77 lines
2.1 KiB
Nix
77 lines
2.1 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.uptime-kuma;
|
|
in
|
|
{
|
|
|
|
meta.maintainers = [ lib.maintainers.julienmalka ];
|
|
|
|
options = {
|
|
services.uptime-kuma = {
|
|
enable = mkEnableOption "Uptime Kuma, this assumes a reverse proxy to be set";
|
|
|
|
package = mkPackageOption pkgs "uptime-kuma" { };
|
|
|
|
appriseSupport = mkEnableOption "apprise support for notifications";
|
|
|
|
settings = lib.mkOption {
|
|
type = lib.types.submodule { freeformType = with lib.types; attrsOf str; };
|
|
default = { };
|
|
example = {
|
|
PORT = "4000";
|
|
NODE_EXTRA_CA_CERTS = "/etc/ssl/certs/ca-certificates.crt";
|
|
};
|
|
description = ''
|
|
Additional configuration for Uptime Kuma, see
|
|
<https://github.com/louislam/uptime-kuma/wiki/Environment-Variables>
|
|
for supported values.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.uptime-kuma.settings = {
|
|
DATA_DIR = "/var/lib/uptime-kuma/";
|
|
NODE_ENV = mkDefault "production";
|
|
HOST = mkDefault "127.0.0.1";
|
|
PORT = mkDefault "3001";
|
|
};
|
|
|
|
systemd.services.uptime-kuma = {
|
|
description = "Uptime Kuma";
|
|
after = [ "network.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
environment = cfg.settings;
|
|
path = with pkgs; [ unixtools.ping ] ++ lib.optional cfg.appriseSupport apprise;
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
StateDirectory = "uptime-kuma";
|
|
DynamicUser = true;
|
|
ExecStart = "${cfg.package}/bin/uptime-kuma-server";
|
|
Restart = "on-failure";
|
|
ProtectHome = true;
|
|
ProtectSystem = "strict";
|
|
PrivateTmp = true;
|
|
PrivateDevices = true;
|
|
ProtectHostname = true;
|
|
ProtectClock = true;
|
|
ProtectKernelTunables = true;
|
|
ProtectKernelModules = true;
|
|
ProtectKernelLogs = true;
|
|
ProtectControlGroups = true;
|
|
NoNewPrivileges = true;
|
|
RestrictRealtime = true;
|
|
RestrictSUIDSGID = true;
|
|
RemoveIPC = true;
|
|
PrivateMounts = true;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|