Package ntfy-sh as NixNG image

This commit is contained in:
Pim Kunis 2024-12-14 21:43:55 +01:00
parent 23e8146077
commit a741e523a0
5 changed files with 42 additions and 28 deletions

View file

@ -1,25 +1,14 @@
{
lib,
config,
globals,
utils,
self,
...
}: {
options.ntfy.enable = lib.mkEnableOption "ntfy";
config = lib.mkIf config.ntfy.enable {
kubernetes.resources = {
configMaps.ntfy.data.config = lib.generators.toYAML {} {
base-url = "https://ntfy.kun.is";
cache-file = "/var/cache/ntfy/cache.db";
cache-duration = "14d";
auth-file = "/var/lib/ntfy/user.db";
auth-default-access = "deny-all";
attachment-cache-dir = "/var/cache/ntfy-attachments";
enable-signup = false;
enable-login = true;
visitor-subscription-limit = 100;
};
deployments.ntfy.spec = {
selector.matchLabels.app = "ntfy";
@ -37,10 +26,9 @@
spec = {
containers.ntfy = {
image = globals.images.ntfy;
image = utils.nixSnapshotterRef (utils.mkNixNGImage "ntfy-sh" "${self}/images/ntfy-sh.nix");
ports.web.containerPort = 80;
env.TZ.value = "Europe/Amsterdam";
args = ["serve"];
volumeMounts = [
{
@ -55,11 +43,6 @@
name = "attachment-cache";
mountPath = "/var/cache/ntfy-attachments";
}
{
name = "config";
mountPath = "/etc/ntfy/server.yml";
subPath = "config";
}
];
};
@ -67,7 +50,6 @@
cache.persistentVolumeClaim.claimName = "cache";
attachment-cache.persistentVolumeClaim.claimName = "attachment-cache";
data.persistentVolumeClaim.claimName = "data";
config.configMap.name = "ntfy";
};
};
};