Served at dagbok.ppp.pm through nginx from 127.0.0.1:8093, with its token from agenix, a Hetzner DNS-01 certificate, a dynamic DNS record and a state backup snapshot.
60 lines
1.2 KiB
Nix
60 lines
1.2 KiB
Nix
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
enabled = config.mod.dagbok.enable;
|
|
nginxEnabled = config.mod.nginx.enable;
|
|
port = 8093;
|
|
in
|
|
{
|
|
options = {
|
|
mod.dagbok = {
|
|
enable = lib.mkEnableOption "Enable dagbok module";
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
inputs.dagbok.nixosModules.default
|
|
];
|
|
|
|
config = lib.mkIf enabled {
|
|
mod.homepage.services = [
|
|
{
|
|
name = "Dagbok";
|
|
port = port;
|
|
description = "Work and personal journal";
|
|
url = "https://dagbok.ppp.pm";
|
|
}
|
|
];
|
|
|
|
services.dagbok = {
|
|
enable = true;
|
|
address = "127.0.0.1";
|
|
inherit port;
|
|
secureCookies = true;
|
|
timeZone = "Europe/Stockholm";
|
|
publicUrl = "https://dagbok.ppp.pm";
|
|
tokenFile = config.age.secrets."dagbok-token".path;
|
|
};
|
|
|
|
services.nginx = lib.mkIf nginxEnabled {
|
|
virtualHosts."dagbok.ppp.pm" = {
|
|
forceSSL = true;
|
|
useACMEHost = "dagbok.ppp.pm";
|
|
extraConfig = ''
|
|
client_max_body_size 32m;
|
|
'';
|
|
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${toString port}";
|
|
};
|
|
};
|
|
};
|
|
|
|
age.secrets."dagbok-token".file = ../../../../secrets/manatee/dagbok-token.age;
|
|
};
|
|
}
|