From ac6a0f59c4bc4b5ce74ee589c8494ac691722f1d Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:23:07 +0200 Subject: [PATCH] temp --- hosts/modules/server/ntfy-sh.nix | 25 +++++++++++++++++++++++++ hosts/modules/server/unifi.nix | 6 ++++++ 2 files changed, 31 insertions(+) create mode 100644 hosts/modules/server/ntfy-sh.nix create mode 100644 hosts/modules/server/unifi.nix diff --git a/hosts/modules/server/ntfy-sh.nix b/hosts/modules/server/ntfy-sh.nix new file mode 100644 index 0000000..91a62be --- /dev/null +++ b/hosts/modules/server/ntfy-sh.nix @@ -0,0 +1,25 @@ +# https://mynixos.com/nixpkgs/options/services.ntfy-sh +let + hostname = "ntfy.anotherhadi.com"; + url = "https://"+hostname; + port = 8082; +in{ + services.ntfy-sh = { + enable = true; + settings = { + base-url = url; + listen-http = "${port}"; + # auth-file + auth-default-access = "deny-all"; + behind-proxy = true; + }; + }; + services.nginx.virtualHosts.${hostname} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${port}"; + }; + }; + networking.firewall.allowedTCPPorts = [ port ]; +} \ No newline at end of file diff --git a/hosts/modules/server/unifi.nix b/hosts/modules/server/unifi.nix new file mode 100644 index 0000000..d9de95d --- /dev/null +++ b/hosts/modules/server/unifi.nix @@ -0,0 +1,6 @@ +{ + services.unifi = { + enable = true; + openFirewall = true; + }; +} \ No newline at end of file