summaryrefslogtreecommitdiff
path: root/hosts/ahmed/nofitications.linus.onl/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/ahmed/nofitications.linus.onl/default.nix')
-rw-r--r--hosts/ahmed/nofitications.linus.onl/default.nix34
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";
+ };
+ };
+ };
+}