onionAddresses: add readonly option 'dataDir'
Used by 'onionServices' in a later commit for services that announce their onion address.
This commit is contained in:
parent
5f34b094d3
commit
fffe988248
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user