mirror of
https://github.com/RGBCube/ncc
synced 2025-08-01 12:37:46 +00:00
plausible: init
This commit is contained in:
parent
b9c640dd78
commit
e7cf9c7239
4 changed files with 49 additions and 1 deletions
39
hosts/best/plausible/default.nix
Normal file
39
hosts/best/plausible/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, self, lib, ... }: let
|
||||
inherit (config.networking) domain;
|
||||
inherit (lib) enabled merge;
|
||||
|
||||
fqdn = "shekels.${domain}";
|
||||
port = 8007;
|
||||
in {
|
||||
imports = [
|
||||
(self + /modules/nginx.nix)
|
||||
(self + /modules/postgresql.nix)
|
||||
];
|
||||
|
||||
secrets.plausibleKey = {
|
||||
file = ./key.age;
|
||||
owner = "plausible";
|
||||
};
|
||||
|
||||
services.postgresql.ensure = [ "plausible" ];
|
||||
|
||||
services.plausible = enabled {
|
||||
server = {
|
||||
disableRegistration = true; # Setting it explicitly just in case.
|
||||
|
||||
secretKeybaseFile = config.secrets.plausibleKey.path;
|
||||
|
||||
baseUrl = "https://${fqdn}";
|
||||
|
||||
listenAddress = "::1";
|
||||
inherit port;
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
|
||||
locations."/" = {
|
||||
proxyPass = "http://[::1]:${toString port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue