From cfac122324e3d05f2925673e99feacf8c3602e0c Mon Sep 17 00:00:00 2001 From: Linnnus Date: Tue, 13 Feb 2024 17:38:25 +0100 Subject: tmp: Move modules/nixos to services/ for shared and hosts/ahmed for private --- hosts/ahmed/nofitications.linus.onl/default.nix | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 hosts/ahmed/nofitications.linus.onl/default.nix (limited to 'hosts/ahmed/nofitications.linus.onl/default.nix') diff --git a/hosts/ahmed/nofitications.linus.onl/default.nix b/hosts/ahmed/nofitications.linus.onl/default.nix new file mode 100644 index 0000000..c050ef4 --- /dev/null +++ b/hosts/ahmed/nofitications.linus.onl/default.nix @@ -0,0 +1,34 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules."notifications.linus.onl"; +in { + options.modules."notifications.linus.onl" = { + enable = mkEnableOption "notifications.linus.onl static site"; + + useACME = mkEnableOption "built-in HTTPS stuff"; + }; + + config = mkIf cfg.enable { + services.push-notification-api = { + enable = true; + }; + + # Register domain name. + services.cloudflare-dyndns.domains = ["notifications.linus.onl"]; + + # Use NGINX as reverse proxy. + services.nginx.virtualHosts."notifications.linus.onl" = { + enableACME = cfg.useACME; + forceSSL = cfg.useACME; + locations."/" = { + recommendedProxySettings = true; + proxyPass = "http://unix:/run/push-notification-api.sock"; + }; + }; + }; +} -- cgit v1.2.3