diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-10-29 15:43:07 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-10-29 15:43:07 +0300 |
commit | 26125aac992416df8a3fd1f860aabcf6a37380ba (patch) | |
tree | 11ecb98248812a2b8392f3a879199835a55e9ee6 /lib/default.nix | |
parent | 2023-10-25 (diff) |
2023-10-29
Diffstat (limited to '')
-rw-r--r-- | lib/default.nix | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix index 4251f7e..be32e60 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -28,11 +28,19 @@ lib: _: rec { assert min <= ini && ini <= max; lib.concatMapStrings (x: toString x + " ") (map (pow 2) [min ini max]); - # TODO Move this to the NGINX module. + # TODO Move these to the NGINX module. nginxInternalOnly = '' if ($internal != 1) { return 403; } access_log off; ''; + nginxAppendHead = text: '' + sub_filter '</head>' '${lib.concatStrings text}</head>'; + sub_filter_once on; + ''; + htmlPlausibleScript = { + domain ? "$host", + src ? "https://plausible.shire.net/js/script.js", + }: ''<script defer data-domain="${domain}" src="${src}"></script>''; } |