From badd9d1a70ad3d5a27b6549b7ee2c1ee796cd079 Mon Sep 17 00:00:00 2001 From: municorn Date: Sat, 5 Apr 2025 22:07:57 -0600 Subject: [PATCH] nixos/taskchampion-sync-server: add host option, fix ExecStart fixes the command line arguments for taskchampion-sync-server, also adding a new `host` option. fixes the corresponding test as well. --- nixos/modules/services/misc/taskchampion-sync-server.nix | 8 +++++++- nixos/tests/taskchampion-sync-server.nix | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/taskchampion-sync-server.nix b/nixos/modules/services/misc/taskchampion-sync-server.nix index bab826829063..272cea170a4f 100644 --- a/nixos/modules/services/misc/taskchampion-sync-server.nix +++ b/nixos/modules/services/misc/taskchampion-sync-server.nix @@ -22,6 +22,12 @@ in type = types.str; default = "taskchampion"; }; + host = lib.mkOption { + description = "Host address on which to serve"; + type = types.str; + default = "127.0.0.1"; + example = "0.0.0.0"; + }; port = lib.mkOption { description = "Port on which to serve"; type = types.port; @@ -79,7 +85,7 @@ in DynamicUser = false; ExecStart = '' ${lib.getExe cfg.package} \ - --port ${builtins.toString cfg.port} \ + --listen "${cfg.host}:${builtins.toString cfg.port}" \ --data-dir ${cfg.dataDir} \ --snapshot-versions ${builtins.toString cfg.snapshot.versions} \ --snapshot-days ${builtins.toString cfg.snapshot.days} \ diff --git a/nixos/tests/taskchampion-sync-server.nix b/nixos/tests/taskchampion-sync-server.nix index 42dfb0cbeca3..659a900fd2c2 100644 --- a/nixos/tests/taskchampion-sync-server.nix +++ b/nixos/tests/taskchampion-sync-server.nix @@ -6,6 +6,7 @@ import ./make-test-python.nix ( nodes = { server = { services.taskchampion-sync-server.enable = true; + services.taskchampion-sync-server.host = "0.0.0.0"; services.taskchampion-sync-server.openFirewall = true; }; client =