Merge fort-nix/nix-bitcoin#745: lnd: make ExecStartPost extensible
ca96e1959elnd: make `ExecStartPost` extensible (Erik Arvstedt) Pull request description: ACKs for top commit: jonasnick: ACKca96e1959eTree-SHA512: 6f0d9f6adbb81b4f58f03c2ab2a70c1f8dc5148f8aba3ea93be68d8be0236edcca7087e673a998052ec3c390ff78b6c009d16ad22f9e600e5c9a683e73f16580
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