add ntfy module
This commit is contained in:
parent
c4354805e5
commit
417453f2f3
3 changed files with 72 additions and 1 deletions
|
|
@ -66,6 +66,18 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# ntfy notification service
|
||||||
|
ntfy = {
|
||||||
|
rule = "Host(`ntfy.yanlincs.com`)";
|
||||||
|
service = "ntfy";
|
||||||
|
tls = {
|
||||||
|
certResolver = "cloudflare";
|
||||||
|
domains = [{
|
||||||
|
main = "*.yanlincs.com";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|
@ -106,7 +118,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Radarr backend
|
# Radarr backend
|
||||||
radarr = {
|
radarr = {
|
||||||
loadBalancer = {
|
loadBalancer = {
|
||||||
servers = [{
|
servers = [{
|
||||||
|
|
@ -115,6 +127,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# ntfy backend
|
||||||
|
ntfy = {
|
||||||
|
loadBalancer = {
|
||||||
|
servers = [{
|
||||||
|
url = "http://localhost:8080";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
../../../modules/traefik.nix
|
../../../modules/traefik.nix
|
||||||
../../../modules/borg/client.nix
|
../../../modules/borg/client.nix
|
||||||
../../../modules/login-display.nix
|
../../../modules/login-display.nix
|
||||||
|
../../../modules/ntfy.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# GRUB bootloader with UEFI support
|
# GRUB bootloader with UEFI support
|
||||||
|
|
|
||||||
49
modules/ntfy.nix
Normal file
49
modules/ntfy.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.ntfy-custom;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.ntfy-custom = {
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = 8080;
|
||||||
|
description = "Port for ntfy to listen on";
|
||||||
|
};
|
||||||
|
|
||||||
|
baseUrl = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "https://ntfy.yanlincs.com";
|
||||||
|
description = "Base URL for ntfy server";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.ntfy-sh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
listen-http = ":${toString cfg.port}";
|
||||||
|
base-url = cfg.baseUrl;
|
||||||
|
|
||||||
|
# Authentication
|
||||||
|
auth-file = "/var/lib/ntfy-sh/user.db";
|
||||||
|
auth-default-access = "deny-all";
|
||||||
|
|
||||||
|
# File attachments
|
||||||
|
attachment-cache-dir = "/var/lib/ntfy-sh/attachments";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Ensure required directories exist
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /var/lib/ntfy-sh 0755 ntfy-sh ntfy-sh -"
|
||||||
|
"d /var/lib/ntfy-sh/attachments 0755 ntfy-sh ntfy-sh -"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
# NOTE: After deployment, manage users via ntfy CLI:
|
||||||
|
# sudo ntfy user add <username>
|
||||||
|
# sudo ntfy user change-pass <username>
|
||||||
|
# sudo ntfy access <username> <topic> <read-write|read-only|write-only|deny-all>
|
||||||
|
# Example: sudo ntfy access alice "*" read-write
|
||||||
Loading…
Add table
Add a link
Reference in a new issue