feat(taskchampion): sync service

This commit is contained in:
arcnmx 2024-09-20 19:46:34 -07:00
parent e9f297d51c
commit e07f689dec
6 changed files with 64 additions and 0 deletions

23
nixos/taskchampion.nix Normal file
View file

@ -0,0 +1,23 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkDefault;
cfg = config.services.taskchampion-sync-server;
in {
services.taskchampion-sync-server = {
enable = mkDefault true;
};
users = mkIf (cfg.enable && cfg.user == "taskchampion") {
users.taskchampion.uid = 917;
groups.taskchampion.gid = config.users.users.taskchampion.uid;
};
systemd.services.taskchampion-sync-server = mkIf cfg.enable {
confinement.enable = true;
gensokyo-zone.sharedMounts.taskchampion.path = mkDefault cfg.dataDir;
};
networking.firewall.interfaces.lan = mkIf cfg.enable {
allowedTCPPorts = [cfg.port];
};
}