From 0d3dfdeb6d2166ed394a15c3899ad9a1cccbfc59 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sat, 7 Oct 2023 17:12:05 +0200 Subject: Bump push-notification-api: Use sockets --- flake.lock | 6 +++--- flake.nix | 1 + modules/nixos/nofitications.linus.onl/default.nix | 11 ++--------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 4482a74..e28ead8 100644 --- a/flake.lock +++ b/flake.lock @@ -148,11 +148,11 @@ ] }, "locked": { - "lastModified": 1696190926, - "narHash": "sha256-P+xHshXroFFglimeXHJLKnP0nC4X5ouZzKtB02/SYo4=", + "lastModified": 1696690837, + "narHash": "sha256-U94HZsKy1rWlH4wfuxWT7tb7pgDEpE48ouROey831y8=", "owner": "linnnus", "repo": "push-notification-api", - "rev": "858b2721db4851488da125363dcc620b98d8b0a3", + "rev": "ee1ff00097f52413e3232d6aba29b6f2e29ef46c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9a0987f..3ab6183 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ }; push-notification-api = { url = "github:linnnus/push-notification-api"; + # url = "path:/home/linus/code/push-notification-api"; inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/modules/nixos/nofitications.linus.onl/default.nix b/modules/nixos/nofitications.linus.onl/default.nix index d77a0e7..c2064ec 100644 --- a/modules/nixos/nofitications.linus.onl/default.nix +++ b/modules/nixos/nofitications.linus.onl/default.nix @@ -8,9 +8,6 @@ domain = "notifications.linus.onl"; - # TODO: Make option internal-port. - internal-port = 13082; - cfg = config.modules."notifications.linus.onl"; in { options.modules."notifications.linus.onl" = { @@ -22,22 +19,18 @@ in { 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. + # Use NGINX as reverse proxy. services.nginx.virtualHosts."notifications.linus.onl" = { enableACME = cfg.useACME; forceSSL = cfg.useACME; locations."/" = { recommendedProxySettings = true; - proxyPass = "http://127.0.0.1:${toString internal-port}"; + proxyPass = "http://unix:/run/push-notification-api.sock"; }; }; }; -- cgit v1.2.3