From bad95afc7bb1439b49d24dc2b709c28dc414f1e1 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Tue, 5 Mar 2024 15:55:49 +0100 Subject: [PATCH] Ntfy setup --- flake.nix | 1 + instances/baldur/configuration.nix | 9 +++++++++ modules/hm/__basic.nix | 4 +--- modules/nixos/ntfy.nix | 16 ++++++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 modules/nixos/ntfy.nix diff --git a/flake.nix b/flake.nix index 9dceb30..0573ba3 100644 --- a/flake.nix +++ b/flake.nix @@ -212,6 +212,7 @@ ./instances/freya/configuration.nix ./modules/nixos/nextcloud.nix + ./modules/nixos/ntfy.nix ] ++ homeManagerModules ++ [ { home-manager.users.bertof = import ./instances/freya/hm.nix; } ]; diff --git a/instances/baldur/configuration.nix b/instances/baldur/configuration.nix index e704ebf..aa792d1 100644 --- a/instances/baldur/configuration.nix +++ b/instances/baldur/configuration.nix @@ -86,6 +86,15 @@ proxy_buffering off; ''; }; + "ntfy.bertof.net" = ssl // { + locations."/" = { + proxyPass = "http://freya.tsn:7080/"; + proxyWebsockets = true; + extraConfig = '' + client_max_body_size 5g; + ''; + }; + }; "my-nextcloud.bertof.net" = ssl // { locations."/" = { proxyPass = "http://freya.tsn:80/"; diff --git a/modules/hm/__basic.nix b/modules/hm/__basic.nix index 369c183..1649a08 100644 --- a/modules/hm/__basic.nix +++ b/modules/hm/__basic.nix @@ -2,9 +2,7 @@ home = { language.base = "it_IT.UTF-8"; packages = builtins.attrValues { - inherit (pkgs) - fd file htop mmv-go neofetch nixos-option pv ripgrep unrar unzip wget - xclip yq zip; + inherit (pkgs) fd file htop mmv-go neofetchnixos-optionntfy-shpvripgrepunrarunzipwget xclip yq zip; }; }; diff --git a/modules/nixos/ntfy.nix b/modules/nixos/ntfy.nix new file mode 100644 index 0000000..3cbf34a --- /dev/null +++ b/modules/nixos/ntfy.nix @@ -0,0 +1,16 @@ +let + port = 7080; +in +{ + services.ntfy-sh = { + enable = true; + settings = { + listen-http = ":${toString port}"; + base-url = "https://ntfy.bertof.net"; + behind-proxy = true; + auth-default-access = "deny-all"; + }; + }; + + networking.firewall.allowedTCPPorts = [ port ]; +}