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
|
let
|
||||||
cfg = config.nix-bitcoin.onionAddresses;
|
cfg = config.nix-bitcoin.onionAddresses;
|
||||||
inherit (config) nix-bitcoin-services;
|
inherit (config) nix-bitcoin-services;
|
||||||
dataDir = "/var/lib/onion-addresses/";
|
|
||||||
in {
|
in {
|
||||||
options.nix-bitcoin.onionAddresses = {
|
options.nix-bitcoin.onionAddresses = {
|
||||||
access = mkOption {
|
access = mkOption {
|
||||||
@ -28,6 +27,10 @@ in {
|
|||||||
/var/lib/onion-addresses/myuser.
|
/var/lib/onion-addresses/myuser.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
dataDir = mkOption {
|
||||||
|
readOnly = true;
|
||||||
|
default = "/var/lib/onion-addresses";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.access != {}) {
|
config = mkIf (cfg.access != {}) {
|
||||||
@ -47,7 +50,7 @@ in {
|
|||||||
# Wait until tor is up
|
# Wait until tor is up
|
||||||
until [[ -e /var/lib/tor/state ]]; do sleep 0.1; done
|
until [[ -e /var/lib/tor/state ]]; do sleep 0.1; done
|
||||||
|
|
||||||
cd ${dataDir}
|
cd ${cfg.dataDir}
|
||||||
rm -rf *
|
rm -rf *
|
||||||
|
|
||||||
${concatMapStrings
|
${concatMapStrings
|
||||||
|
Loading…
Reference in New Issue
Block a user