From 662a7f7b9f88aaefd4c2eb49396799ff10a82221 Mon Sep 17 00:00:00 2001 From: Romain Paquet Date: Tue, 11 Feb 2025 20:42:50 +0100 Subject: [PATCH] move taskchampion persistence to its own module --- hosts/genepi/persistence.nix | 2 -- hosts/genepi/taskchampion.nix | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hosts/genepi/persistence.nix b/hosts/genepi/persistence.nix index b0010bf..c0651d9 100644 --- a/hosts/genepi/persistence.nix +++ b/hosts/genepi/persistence.nix @@ -22,8 +22,6 @@ "/etc/ssh/ssh_host_ed25519_key.pub" # tailscale "/var/lib/tailscale/tailscaled.state" - # taskchampion - "/var/lib/taskchampion-sync-server/taskchampion-sync-server.sqlite3" ]; users.rpqt = { directories = [ ]; diff --git a/hosts/genepi/taskchampion.nix b/hosts/genepi/taskchampion.nix index 5108dcd..b06dbc5 100644 --- a/hosts/genepi/taskchampion.nix +++ b/hosts/genepi/taskchampion.nix @@ -1,11 +1,15 @@ -{ config, ... }: +{ config, lib, ... }: let domain = "home.rpqt.fr"; subdomain = "tw.${domain}"; + hasImpermanence = config.environment.persistence."/persist".enable; in { services.taskchampion-sync-server.enable = true; + services.taskchampion-sync-server.dataDir = + (lib.optionalString hasImpermanence "/persist") + "/var/lib/taskchampion-sync-server"; + services.nginx.virtualHosts.${subdomain} = { forceSSL = true; useACMEHost = "${domain}";