rework actual-budget to be more generic with test
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ lib, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "actual-budget";
|
||||
@@ -6,49 +6,21 @@
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
interface.options = {
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "budget";
|
||||
description = "Sub domain for Actual Budget.";
|
||||
};
|
||||
};
|
||||
|
||||
perInstance =
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
settings,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
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}";
|
||||
};
|
||||
};
|
||||
};
|
||||
services.actual = {
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
clan.core.state.actual-budget.folders = [
|
||||
config.systemd.services.actual.serviceConfig.WorkingDirectory
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user