From b228ea123dda1d5295e71c5cf5ed6996666da91a Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 11 Jan 2025 10:56:32 +0000 Subject: [PATCH] servo: clightning: rebalance channels in the background, always --- modules/services/clightning.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/services/clightning.nix b/modules/services/clightning.nix index 341fa0454..d0f78ca06 100644 --- a/modules/services/clightning.nix +++ b/modules/services/clightning.nix @@ -207,6 +207,21 @@ in ''; }; + systemd.services.clightning-autobalance = { + description = "shuffle funds around to improve routability (in a no-cost manner)"; + after = [ "clightning.service" ]; + bindsTo = [ "clightning.service" ]; + wantedBy = [ "clightning.service" ]; + serviceConfig.Restart = "always"; + serviceConfig.RestartSec = "600"; + + serviceConfig.ExecStart = "${lib.getExe pkgs.clightning-sane} autobalance"; + serviceConfig.Type = "simple"; + serviceConfig.User = cfg.user; + + # TODO: sandbox (just follow what i do for clightning-sane) + }; + users.users.${cfg.user} = { isSystemUser = true; group = cfg.group;