infrastructure

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 8e5abd11968e3af0cf258d1aeb39982212a407be
parent 0959fb05c703735262acbbedc7077bf863575818
Author: Silas Brack <silasbrack@gmail.com>
Date:   Fri, 12 Jun 2026 21:19:26 +0200

feat: move simple-web-app DB to Hetzner volume for durability

DB now at /mnt/volume-hel1-1/simple-web-app/data/app.db instead
of the root disk. Volume survives OS reinstalls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
Mmodules/simple-web-app.nix | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/simple-web-app.nix b/modules/simple-web-app.nix @@ -30,7 +30,7 @@ in dbPath = mkOption { type = types.str; - default = "/var/lib/simple-web-app/data/app.db"; + default = "/mnt/volume-hel1-1/simple-web-app/data/app.db"; description = '' Path to the SQLite database file. ''; @@ -58,6 +58,13 @@ in DynamicUser = true; StateDirectory = "simple-web-app"; StateDirectoryMode = "0755"; + ReadWritePaths = [ "/mnt/volume-hel1-1/simple-web-app" ]; + ExecStartPre = let + setupScript = pkgs.writeShellScript "simple-web-app-setup" '' + mkdir -p /mnt/volume-hel1-1/simple-web-app/data + chmod 755 /mnt/volume-hel1-1/simple-web-app/data + ''; + in "+${setupScript}"; }; environment = { PORT = builtins.toString cfg.port;