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.
This commit is contained in:
+4
-2
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user