Skip to content

ntfy

Examples

Simple

nix
{
  ntfy.enable = true;
}

With Authentication

nix
{config, ...}: {
  ntfy = {
    enable = true;

    settings = {
      enable-login = true;
      auth-default-access = "deny-all";
      auth-users = [
        "admin:{{ file.Read `${config.sops.secrets."users/admin/password_bcrypt".path}` }}:admin"
        "monitoring:{{ file.Read `${config.sops.secrets."users/monitoring/password_bcrypt".path}` }}:user"
      ];
      auth-access = [
        "monitoring:monitoring:rw"
      ];
      auth-tokens = [
        "monitoring:{{ file.Read `${config.sops.secrets."users/monitoring/ntfy_access_token".path}` }}"
      ];
    };
  };
}

Stack Options

nps.stacks.ntfy.containers.ntfy

Alias of {option}services.podman.containers.ntfy.

Type
plaintext
submodule
Declaration

nps.stacks.ntfy.enable

Whether to enable ntfy.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

nps.stacks.ntfy.enableGrafanaDashboard

Whether to enable Grafana Dashboard.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

nps.stacks.ntfy.enablePrometheusExport

Whether to enable Prometheus Export.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

nps.stacks.ntfy.extraEnv

Extra environment variables to set for the container. Variables can be either set directly or sourced from a file (e.g. for secrets).

For example in order to enable web push support, make sure you pass the 'NTFY_WEB_PUSH_PUBLIC_KEY', 'NTFY_WEB_PUSH_PRIVATE_KEY' & 'NTFY_WEB_PUSH_EMAIL_ADDRESS' variables. Keys can be generated by running podman run --rm docker.io/binwiederhier/ntfy:latest webpush keys

Type
plaintext
attribute set of (null or boolean or signed integer or string or absolute path or (submodule))
Declaration

nps.stacks.ntfy.settings

Server configuration (alternative to environment variable based configuration). Will be mounted as /etc/ntfy/server.yml in the container.

The final configuration file will be templated with gomplate, so secrets can be read from files or environment variables.

See

Type
plaintext
YAML 1.1 value
Default
nix
{ }
Example
nix
{
  auth-default-access = "deny-all";
  enable-login = true;
  web-push-private-key = "{{ file.Read `/run/secrets/web_push_private_key` }}";
}
Declaration