Add service ActualBudget

This commit is contained in:
pazpi 2026-03-26 22:41:11 +01:00
parent 888d0e1271
commit 9d623b94e1
No known key found for this signature in database
9 changed files with 132 additions and 0 deletions

View file

@ -0,0 +1,70 @@
{
lib,
config,
...
}:
let
cfg = config.my.services.actual;
in
{
options.my.services.actual = {
enable = lib.mkEnableOption "Actual Budget server (services.actual)";
settings = lib.mkOption {
default = { };
description = ''
Merged into services.actual.settings. Use `._secret` for file-backed
values per upstream Actual / NixOS module docs.
'';
};
proxy = {
enable = lib.mkEnableOption "Set the Caddy reverse proxy entry for this service";
domain = lib.mkOption {
default = "example.com";
type = lib.types.str;
description = ''
The domain where Caddy is reachable
'';
};
subdomain = lib.mkOption {
default = "budget";
type = lib.types.str;
description = ''
Subdomain for Actual Budget
'';
};
host = lib.mkOption {
default = "localhost";
type = lib.types.str;
description = ''
Hostname where Actual is listening
'';
};
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
services.actual = {
enable = true;
openFirewall = true;
settings = cfg.settings;
};
})
(lib.mkIf cfg.proxy.enable {
services.caddy = with cfg.proxy; {
virtualHosts."${subdomain}.${domain}".extraConfig = ''
reverse_proxy http://${host}:${toString config.services.actual.settings.port}
import cloudflare_${domain}
'';
};
})
];
}

View file

@ -1,5 +1,6 @@
{
imports = [
./actual.nix
./authentik.nix
./dashy.nix
./firefly-iii.nix