From ca96e1959eb42a94ad45e1c719449d3f20d40420 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 6 Nov 2024 16:48:30 +0100 Subject: [PATCH] lnd: make `ExecStartPost` extensible By wrapping the value in a list, users can add other `ExecStartPost` scripts. The previous scalar value could only be replaced, but not merged with other definitions. --- modules/lnd.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/lnd.nix b/modules/lnd.nix index 701bb90..05c8c7b 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -262,9 +262,8 @@ in { ExecStartPost = let curl = "${pkgs.curl}/bin/curl -fsS --cacert ${cfg.certPath}"; restUrl = "https://${nbLib.addressWithPort cfg.restAddress cfg.restPort}/v1"; - in # Setting macaroon permissions for other users needs root permissions - nbLib.rootScript "lnd-create-macaroons" '' + script = nbLib.rootScript "lnd-create-macaroons" '' umask ug=r,o= ${lib.concatMapStrings (macaroon: '' echo "Create custom macaroon ${macaroon}" @@ -278,6 +277,9 @@ in { chown ${cfg.macaroons.${macaroon}.user}: "$macaroonPath" '') (attrNames cfg.macaroons)} ''; + in [ + script + ]; } // nbLib.allowedIPAddresses cfg.tor.enforce; };