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:
parent
951c61b8ec
commit
ca96e1959e
1 changed files with 4 additions and 2 deletions
|
|
@ -262,9 +262,8 @@ in {
|
||||||
ExecStartPost = let
|
ExecStartPost = let
|
||||||
curl = "${pkgs.curl}/bin/curl -fsS --cacert ${cfg.certPath}";
|
curl = "${pkgs.curl}/bin/curl -fsS --cacert ${cfg.certPath}";
|
||||||
restUrl = "https://${nbLib.addressWithPort cfg.restAddress cfg.restPort}/v1";
|
restUrl = "https://${nbLib.addressWithPort cfg.restAddress cfg.restPort}/v1";
|
||||||
in
|
|
||||||
# Setting macaroon permissions for other users needs root permissions
|
# Setting macaroon permissions for other users needs root permissions
|
||||||
nbLib.rootScript "lnd-create-macaroons" ''
|
script = nbLib.rootScript "lnd-create-macaroons" ''
|
||||||
umask ug=r,o=
|
umask ug=r,o=
|
||||||
${lib.concatMapStrings (macaroon: ''
|
${lib.concatMapStrings (macaroon: ''
|
||||||
echo "Create custom macaroon ${macaroon}"
|
echo "Create custom macaroon ${macaroon}"
|
||||||
|
|
@ -278,6 +277,9 @@ in {
|
||||||
chown ${cfg.macaroons.${macaroon}.user}: "$macaroonPath"
|
chown ${cfg.macaroons.${macaroon}.user}: "$macaroonPath"
|
||||||
'') (attrNames cfg.macaroons)}
|
'') (attrNames cfg.macaroons)}
|
||||||
'';
|
'';
|
||||||
|
in [
|
||||||
|
script
|
||||||
|
];
|
||||||
} // nbLib.allowedIPAddresses cfg.tor.enforce;
|
} // nbLib.allowedIPAddresses cfg.tor.enforce;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue