From 3b0ee83188d3456400cb654f0dc3133f72842ed2 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Sat, 25 Nov 2023 15:15:32 +0000 Subject: [PATCH] Continue adding deployment config --- flake.nix | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 2b62281..a9864da 100644 --- a/flake.nix +++ b/flake.nix @@ -80,14 +80,28 @@ options.wish.service = { enable = mkEnableOption "Enable the wish service."; + stateDir = mkOption { + type = types.str; + default = "/var/lib/wish"; + description = lib.mdDoc "Wish data directory."; + }; + environmentFile = mkOption { type = types.path; description = lib.mdDoc '' Environment file as defined in {manpage}`systemd.exec(5)` passed to the service. + ''; + }; - This must contain at least `LIVEBOOK_PASSWORD` or - `LIVEBOOK_TOKEN_ENABLED=false`. See `livebook server --help` - for other options.''; + databasePath = mkOption { + type = types.str; + default = "${cfg.stateDir}/data/wish.db"; + description = lib.mdDoc "Path to the sqlite3 database file."; + }; + + secretKeyBase = mkOption { + type = types.str; + description = lib.mdDoc "Phoenix secret key base."; }; }; @@ -102,6 +116,11 @@ Restart = "on-failure"; ExecStart = "${pkg}/bin/wish start"; }; + + environment = { + DATABASE_PATH = cfg.databasePath; + SECRET_KEY_BASE = cfg.secretKeyBase; + }; }; }; };