From c475c0077764acea6f12b88b24d20b7b2720cd5c Mon Sep 17 00:00:00 2001 From: Linnnus Date: Tue, 3 Oct 2023 19:24:59 +0200 Subject: Move personal modules hosts/ahmed -> modules/nixos/ --- hosts/ahmed/notifications.linus.onl.nix | 44 --------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 hosts/ahmed/notifications.linus.onl.nix (limited to 'hosts/ahmed/notifications.linus.onl.nix') diff --git a/hosts/ahmed/notifications.linus.onl.nix b/hosts/ahmed/notifications.linus.onl.nix deleted file mode 100644 index d77a0e7..0000000 --- a/hosts/ahmed/notifications.linus.onl.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: let - inherit (lib) mkEnableOption mkOption types mkIf optional; - - domain = "notifications.linus.onl"; - - # TODO: Make option internal-port. - internal-port = 13082; - - 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; - # host = "notifications.linus.onl"; - host = "0.0.0.0"; - port = internal-port; - openFirewall = false; # We're using NGINX reverse proxy. - }; - - # Register domain name. - services.cloudflare-dyndns.domains = ["notifications.linus.onl"]; - - # Serve the generated page using NGINX. - services.nginx.virtualHosts."notifications.linus.onl" = { - enableACME = cfg.useACME; - forceSSL = cfg.useACME; - locations."/" = { - recommendedProxySettings = true; - proxyPass = "http://127.0.0.1:${toString internal-port}"; - }; - }; - }; -} -- cgit v1.2.3