actual budget service

This commit is contained in:
2025-07-17 09:38:37 +07:00
parent 528ef9ab77
commit 872414c995
2 changed files with 62 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
pocket-id = ../modules/clan/pocket-id;
nextcloud = ../modules/clan/nextcloud;
stirling-pdf = ../modules/clan/stirling-pdf;
actual-budget = ../modules/clan/actual-budget;
};
inventory = {
@@ -38,6 +39,13 @@
};
roles.default.machines.b4l = { };
};
actual-budget = {
module = {
name = "actual-budget";
input = "self";
};
roles.default.machines.b4l = { };
};
};
services = {

View File

@@ -0,0 +1,54 @@
{ lib, ... }:
{
_class = "clan.service";
manifest.name = "actual-budget";
manifest.description = "A local-first personal finance app ";
manifest.categories = [ "System" ];
roles.default = {
interface.options = {
domain = lib.mkOption {
type = lib.types.str;
default = "budget";
description = "Sub domain for Actual Budget.";
};
};
perInstance =
{
settings,
...
}:
{
nixosModule =
{
config,
...
}:
let
domain = "${settings.domain}.${config.networking.fqdn}";
in
{
services.actual = {
enable = true;
openFirewall = true;
settings = {
port = 5006;
allowedLoginMethods = [
"password"
"openid"
];
trustedProxies = [ "127.0.0.1" ];
};
};
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
useACMEHost = "${config.networking.fqdn}";
locations."/" = {
proxyPass = "http://localhost:${builtins.toString config.services.actual.settings.port}";
};
};
};
};
};
}