aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/actual.nix37
1 files changed, 19 insertions, 18 deletions
diff --git a/modules/actual.nix b/modules/actual.nix
index ead1459..62593a1 100644
--- a/modules/actual.nix
+++ b/modules/actual.nix
@@ -2,30 +2,31 @@
# Actual Budget - local-first personal finance application.
#
-# Uses the NixOS native module (services.actual) available in nixpkgs 24.11+.
+# Runs as a Podman OCI container because the native services.actual NixOS
+# module is not available in nixos-24.11. The container listens on
+# 127.0.0.1:5006; Caddy handles public HTTPS termination.
+#
# On first visit to https://budget.karanj.com the app prompts you to set a
# server password in the browser - no pre-configuration needed.
#
-# All budget data is stored in /var/lib/actual (persists across reboots).
+# All budget data is persisted in /var/lib/actual on the host.
{
- services.actual = {
- enable = true;
+ # Ensure the data directory exists before the container starts
+ systemd.tmpfiles.rules = [
+ "d /var/lib/actual 0750 root root -"
+ ];
+
+ virtualisation.oci-containers.containers.actual = {
+ image = "docker.io/actualbudget/actual-server:latest";
- settings = {
- # Listen on localhost only; Caddy handles public HTTPS
- hostname = "127.0.0.1";
- port = 5006;
+ ports = [ "127.0.0.1:5006:5006" ];
- # Tell Actual its public URL so HTTPS redirects work correctly
- serverFiles = "/var/lib/actual/server-files";
- userFiles = "/var/lib/actual/user-files";
+ volumes = [
+ "/var/lib/actual:/data"
+ ];
+
+ environment = {
+ ACTUAL_PORT = "5006";
};
};
-
- # Ensure data directory exists with correct ownership
- systemd.tmpfiles.rules = [
- "d /var/lib/actual 0750 actual actual -"
- "d /var/lib/actual/server-files 0750 actual actual -"
- "d /var/lib/actual/user-files 0750 actual actual -"
- ];
}