new uptime-kuma service, new drive
This commit is contained in:
parent
7a9f880f6d
commit
4bf1b55911
4 changed files with 52 additions and 6 deletions
33
modules/services/uptime.nix
Normal file
33
modules/services/uptime.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ config, lib, pkgs, options, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.services.uptime;
|
||||
in {
|
||||
options.modules.services.uptime = {
|
||||
enable = mkEnableOption "enable uptime kuma, a self-hosted uptime website";
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 3002;
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "status.reidlab.pink";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.uptime-kuma = {
|
||||
enable = true;
|
||||
settings.PORT = toString cfg.port;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${cfg.domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue