diff options
author | Linnnus <[email protected]> | 2024-02-13 17:38:25 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-02-13 17:39:52 +0100 |
commit | cfac122324e3d05f2925673e99feacf8c3602e0c (patch) | |
tree | 73eed7262b94f3678f38f32ba951970e2d0bd066 /hosts/ahmed/nofitications.linus.onl | |
parent | bbbdbd1094f1f09b8075da88f6b412d2e4af80ca (diff) |
tmp: Move modules/nixos to services/ for shared and hosts/ahmed for private
Diffstat (limited to 'hosts/ahmed/nofitications.linus.onl')
-rw-r--r-- | hosts/ahmed/nofitications.linus.onl/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
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"; + }; + }; + }; +} |