installed actual on defiant

This commit is contained in:
Leyla Becker 2025-08-21 22:02:10 -05:00
parent 102a61b38e
commit d12f4b5327
4 changed files with 75 additions and 0 deletions

View file

@ -284,6 +284,11 @@
subdomain = "search"; subdomain = "search";
}; };
actual = {
enable = true;
subdomain = "budget";
};
home-assistant = { home-assistant = {
enable = true; enable = true;
subdomain = "home"; subdomain = "home";

View file

@ -0,0 +1,54 @@
{
lib,
config,
...
}: let
dataDirectory = "/var/lib/actual/";
in {
options.services.actual = {
subdomain = lib.mkOption {
type = lib.types.str;
default = "actual";
description = "subdomain of base domain that actual will be hosted at";
};
};
config = lib.mkIf config.services.actual.enable (lib.mkMerge [
{
systemd.tmpfiles.rules = [
"d ${dataDirectory} 2770 actual actual"
];
host = {
reverse_proxy.subdomains.${config.services.actual.subdomain} = {
target = "http://localhost:${toString config.services.actual.settings.port}";
};
};
services.actual = {
settings = {
ACTUAL_DATA_DIR = dataDirectory;
};
};
}
(lib.mkIf config.services.fail2ban.enable {
# TODO: configuration for fail2ban for actual
})
(lib.mkIf config.host.impermanence.enable {
assertions = [
{
assertion = config.services.actual.settings.ACTUAL_DATA_DIR == dataDirectory;
message = "actual data location does not match persistence";
}
];
environment.persistence."/persist/system/root" = {
directories = [
{
directory = dataDirectory;
user = "actual";
group = "actual";
}
];
};
})
]);
}

View file

@ -13,5 +13,6 @@
./immich.nix ./immich.nix
./qbittorent.nix ./qbittorent.nix
./paperless.nix ./paperless.nix
./actual.nix
]; ];
} }

View file

@ -24,6 +24,7 @@
immich = 2010; immich = 2010;
qbittorrent = 2011; qbittorrent = 2011;
paperless = 2012; paperless = 2012;
actual = 2013;
}; };
gids = { gids = {
@ -40,6 +41,7 @@
immich = 2010; immich = 2010;
qbittorrent = 2011; qbittorrent = 2011;
paperless = 2012; paperless = 2012;
actual = 2013;
}; };
users = config.users.users; users = config.users.users;
@ -169,6 +171,12 @@ in {
isSystemUser = true; isSystemUser = true;
group = config.users.users.paperless.name; group = config.users.users.paperless.name;
}; };
actual = {
uid = lib.mkForce uids.actual;
isSystemUser = true;
group = config.users.users.actual.name;
};
}; };
groups = { groups = {
@ -272,6 +280,13 @@ in {
users.paperless.name users.paperless.name
]; ];
}; };
actual = {
gid = lib.mkForce gids.actual;
members = [
users.actual.name
];
};
}; };
}; };
} }