diff --git a/modules/onion-addresses.nix b/modules/onion-addresses.nix index 905f73d..f715337 100644 --- a/modules/onion-addresses.nix +++ b/modules/onion-addresses.nix @@ -11,7 +11,6 @@ with lib; let cfg = config.nix-bitcoin.onionAddresses; inherit (config) nix-bitcoin-services; - dataDir = "/var/lib/onion-addresses/"; in { options.nix-bitcoin.onionAddresses = { access = mkOption { @@ -28,6 +27,10 @@ in { /var/lib/onion-addresses/myuser. ''; }; + dataDir = mkOption { + readOnly = true; + default = "/var/lib/onion-addresses"; + }; }; config = mkIf (cfg.access != {}) { @@ -47,7 +50,7 @@ in { # Wait until tor is up until [[ -e /var/lib/tor/state ]]; do sleep 0.1; done - cd ${dataDir} + cd ${cfg.dataDir} rm -rf * ${concatMapStrings