nix-bitcoin.nix: add defaultText (automatic)
This enables generating module option documentation.
This commit was genereated by running the following script inside the
repo root dir:
def add_default_text(file)
src = File.read(file)
src2 = src.gsub(/( = mkOption\s+\{[^{]*?)(\n\s+default = )(.*?);$(.*?\})/m) do |str|
pre, defaultVar, default, post = Regexp.last_match.captures
replacement =
if !post.include?('defaultText =')
if default =~ /\bpkgs\b/
defaultText = default.lines.length == 1 ? default : "(See source)"
"#{pre}#{defaultVar}#{default};#{defaultVar.sub('default', 'defaultText')}#{defaultText.inspect};#{post}"
end
end
replacement or str
end
File.write(file, src2) if src2 != src
end
Dir["modules/**/*.nix"].each do |f|
next if File.basename(f) == "nix-bitcoin.nix"
add_default_text f
end
This commit is contained in:
@@ -57,6 +57,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.bitcoind;
|
||||
defaultText = "config.nix-bitcoin.pkgs.bitcoind";
|
||||
description = "The package providing bitcoin binaries.";
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
@@ -265,6 +266,7 @@ let
|
||||
default = pkgs.writeScriptBin "bitcoin-cli" ''
|
||||
exec ${cfg.package}/bin/bitcoin-cli -datadir='${cfg.dataDir}' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary to connect with the bitcoind instance.";
|
||||
};
|
||||
tor = nbLib.tor;
|
||||
|
||||
@@ -21,6 +21,7 @@ let
|
||||
config.nix-bitcoin.pkgs.btcpayserver.override { altcoinSupport = true; }
|
||||
else
|
||||
config.nix-bitcoin.pkgs.btcpayserver;
|
||||
defaultText = "(See source)";
|
||||
description = "The package providing btcpayserver binaries.";
|
||||
};
|
||||
dataDir = mkOption {
|
||||
@@ -69,6 +70,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.nbxplorer;
|
||||
defaultText = "config.nix-bitcoin.pkgs.nbxplorer";
|
||||
description = "The package providing nbxplorer binaries.";
|
||||
};
|
||||
address = mkOption {
|
||||
|
||||
@@ -17,6 +17,7 @@ let cfg = config.services.clightning.plugins.clboss; in
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.clboss;
|
||||
defaultText = "config.nix-bitcoin.pkgs.clboss";
|
||||
description = "The package providing clboss binaries.";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -69,6 +69,7 @@ let
|
||||
default = pkgs.writeScriptBin "lightning-cli" ''
|
||||
${nbPkgs.clightning}/bin/lightning-cli --lightning-dir='${cfg.dataDir}' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary to connect with the clightning instance.";
|
||||
};
|
||||
getPublicAddressCmd = mkOption {
|
||||
|
||||
@@ -27,6 +27,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.lightning-loop;
|
||||
defaultText = "config.nix-bitcoin.pkgs.lightning-loop";
|
||||
description = "The package providing lightning-loop binaries.";
|
||||
};
|
||||
dataDir = mkOption {
|
||||
@@ -54,6 +55,7 @@ let
|
||||
--macaroonpath '${cfg.dataDir}/${network}/loop.macaroon' \
|
||||
--tlscertpath '${secretsDir}/loop-cert' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary to connect with the lightning-loop instance.";
|
||||
};
|
||||
tor = nbLib.tor;
|
||||
|
||||
@@ -27,6 +27,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.lightning-pool;
|
||||
defaultText = "config.nix-bitcoin.pkgs.lightning-pool";
|
||||
description = "The package providing lightning-pool binaries.";
|
||||
};
|
||||
dataDir = mkOption {
|
||||
@@ -54,6 +55,7 @@ let
|
||||
--network ${network} \
|
||||
--basedir '${cfg.dataDir}' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary to connect with the lightning-pool instance.";
|
||||
};
|
||||
tor = nbLib.tor;
|
||||
|
||||
@@ -148,12 +148,14 @@ let
|
||||
default = pkgs.writeScriptBin "elements-cli" ''
|
||||
${nbPkgs.elementsd}/bin/elements-cli -datadir='${cfg.dataDir}' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary to connect with the liquidd instance.";
|
||||
};
|
||||
swapCli = mkOption {
|
||||
default = pkgs.writeScriptBin "liquidswap-cli" ''
|
||||
${nbPkgs.liquid-swap}/bin/liquidswap-cli -c '${cfg.dataDir}/elements.conf' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary for managing liquid swaps.";
|
||||
};
|
||||
tor = nbLib.tor;
|
||||
|
||||
@@ -15,6 +15,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.lndconnect;
|
||||
defaultText = "config.nix-bitcoin.pkgs.lndconnect";
|
||||
description = "The package providing lndconnect binaries.";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -81,6 +81,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = config.nix-bitcoin.pkgs.lnd;
|
||||
defaultText = "config.nix-bitcoin.pkgs.lnd";
|
||||
description = "The package providing lnd binaries.";
|
||||
};
|
||||
cli = mkOption {
|
||||
@@ -92,6 +93,7 @@ let
|
||||
--tlscertpath '${cfg.certPath}' \
|
||||
--macaroonpath '${networkDir}/admin.macaroon' "$@"
|
||||
'';
|
||||
defaultText = "(See source)";
|
||||
description = "Binary to connect with the lnd instance.";
|
||||
};
|
||||
getPublicAddressCmd = mkOption {
|
||||
|
||||
Reference in New Issue
Block a user