From ecc601a6d6654f782a9d6b5229ab712e9600b4fe Mon Sep 17 00:00:00 2001 From: nixbitcoin Date: Tue, 16 Feb 2021 16:53:35 +0000 Subject: [PATCH] onion-addresses: mirror nix-bitcoin.onionAddresses.access behavior This commit fixes an issue with LND, in which if both nix-bitcoin.onionServices.lnd.public & services.lnd.restOnionService.enable were enabled, one would try to create a file named `lnd` and the other would try to create a directory named `lnd` with a file named `lnd-rest` inside it. This would obiously cause an error and fail the LND service. --- modules/onion-addresses.nix | 2 +- modules/onion-services.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/onion-addresses.nix b/modules/onion-addresses.nix index 64cda59..e3872a9 100644 --- a/modules/onion-addresses.nix +++ b/modules/onion-addresses.nix @@ -84,7 +84,7 @@ in { ${concatMapStrings (service: '' onionFile=/var/lib/tor/onion/${service}/hostname if [[ -e $onionFile ]]; then - install -o ${config.systemd.services.${service}.serviceConfig.User} -m 400 $onionFile ${service} + install -D -o ${config.systemd.services.${service}.serviceConfig.User} -m 400 $onionFile services/${service} fi '') cfg.services} ''; diff --git a/modules/onion-services.nix b/modules/onion-services.nix index 288e673..a250c0b 100644 --- a/modules/onion-services.nix +++ b/modules/onion-services.nix @@ -94,7 +94,7 @@ in { in srv.public && srv.enable ) services; in genAttrs publicServices' (service: { - getPublicAddressCmd = "cat ${config.nix-bitcoin.onionAddresses.dataDir}/${service}"; + getPublicAddressCmd = "cat ${config.nix-bitcoin.onionAddresses.dataDir}/services/${service}"; }); }