add hister

This commit is contained in:
Noah Masur
2026-09-05 21:15:02 +00:00
parent 6e0f4e2000
commit aff596aa64
3 changed files with 61 additions and 0 deletions
@@ -0,0 +1,59 @@
{
config,
lib,
...
}:
let
inherit (config.nmasur.settings) hostnames;
cfg = config.nmasur.presets.services.hister;
in
{
options.nmasur.presets.services.hister = {
enable = lib.mkEnableOption "Hister web history service";
port = lib.mkOption {
type = lib.types.port;
description = "Port to use for the localhost";
default = 4433;
};
};
config = lib.mkIf cfg.enable {
services.hister = {
enable = true;
port = cfg.port;
settings = {
app = {
user_handling = true;
};
server = {
base_url = "https://${hostnames.hister}";
};
};
};
# Adding new users:
# sudo -u hister hister --config /run/hister/config.yml create-user <username> --admin
# Allow web traffic to Caddy
nmasur.presets.services.caddy.routes = [
{
match = [ { host = [ hostnames.hister ]; } ];
handle = [
{
handler = "reverse_proxy";
upstreams = [ { dial = "localhost:${builtins.toString cfg.port}"; } ];
}
];
}
];
# Configure Cloudflare DNS to point to this machine
services.cloudflare-dyndns.domains = [ hostnames.hister ];
};
}
@@ -43,6 +43,7 @@ in
cloudflared.enable = lib.mkDefault true;
gitea.enable = lib.mkDefault true;
grafana.enable = lib.mkDefault true;
hister.enable = lib.mkDefault true;
influxdb2.enable = lib.mkDefault true;
karakeep.enable = lib.mkDefault true;
litestream.enable = lib.mkDefault true;