semi-failed packaging of actual budget prometheus exporter

This commit is contained in:
Noah Masur
2025-04-23 19:20:45 +00:00
parent 562295edb1
commit 11e0992d99
4 changed files with 134 additions and 4 deletions

View File

@ -1,5 +1,6 @@
{
config,
pkgs,
lib,
...
}:
@ -18,6 +19,11 @@ in
description = "Port to use for the localhost";
default = 5006;
};
prometheusPort = lib.mkOption {
type = lib.types.port;
description = "Port to use for prometheus actual exporter";
default = 5007;
};
};
config = lib.mkIf cfg.enable {
@ -25,10 +31,30 @@ in
services.actual = {
enable = true;
settings = {
port = 5006;
port = cfg.port;
};
};
# systemd.services.prometheus-actual-exporter = {
# enable = true;
# description = "Prometheus exporter for Actual budget";
# serviceConfig = {
# DynamicUser = true;
# Environment = [
# "ACTUAL_SERVER_URL=https://${hostnames.budget}:443"
# "PORT=${builtins.toString cfg.prometheusPort}"
# ];
# EnvironmentFile = [
# config.secrets.actualbudget-password.dest
# config.secrets.actualbudget-budget-id.dest
# ];
# ExecStart = lib.getExe pkgs.nmasur.prometheus-actual-exporter;
# };
# wantedBy = [
# "multi-user.target"
# ];
# };
# Used for prometheus exporter
virtualisation.podman.enable = true;
@ -66,7 +92,7 @@ in
};
nmasur.presets.services.prometheus-exporters.scrapeTargets = [
"127.0.0.1:5007"
"127.0.0.1:${builtins.toString cfg.prometheusPort}"
];
secrets.actualbudget-password = {
@ -99,7 +125,7 @@ in
services.cloudflare-dyndns.domains = [ hostnames.budget ];
# Backups
services.restic.backups.default.paths = [ "/var/lib/actualbudget" ];
services.restic.backups.default.paths = [ "/var/lib/actual" ];
};

View File

@ -103,8 +103,9 @@ in
value = name;
}) hostname_map;
};
metrics = { }; # Enables Prometheus metrics
};
apps.http.servers.metrics = { }; # Enables Prometheus metrics
apps.tls.automation.policies = cfg.tlsPolicies;
# Setup logging to journal and files