Files
nix-bitcoin/modules/nix-bitcoin.nix
T
plebandClaude Opus 5.5 5d7289532b Drop pinned nixpkgs inputs and the local lndinit
Take every package from the consumer's pkgs: bitcoind, lnd, electrs and
lndinit (0.1.3 -> nixpkgs' version; gen-seed and init-wallet flags are
unchanged). The flake now has a single nixpkgs input. Removes
useVersionLockedPkgs, pinned.nix, nixpkgs-pinned.nix, shell.nix and the
update-flake helper that generated pinned.nix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:45:22 -08:00

68 lines
1.8 KiB
Nix

{ config, options, pkgs, lib, ... }:
with lib;
{
options = {
nix-bitcoin = {
pkgs = mkOption {
type = types.attrs;
default = import ../pkgs { inherit pkgs; };
defaultText = "nix-bitcoin/pkgs";
apply = base:
let
final = foldl (prev: overlay:
prev // (overlay prev final)
) base options.nix-bitcoin.pkgOverlays.definitions;
in
final;
};
pkgOverlays = mkOption {
internal = true;
type = with types; functionTo attrs;
example = lib.literalExpression ''
super: self: {
bitcoind = super.bitcoind.overrideAttrs (old: {
# dostuff
});
}
'';
};
lib = mkOption {
readOnly = true;
default = import ../pkgs/lib.nix lib pkgs config;
defaultText = "nix-bitcoin/pkgs/lib.nix";
};
torClientAddressWithPort = mkOption {
readOnly = true;
default = with config.services.tor.client.socksListenAddress;
"${addr}:${toString port}";
defaultText = "(See source)";
};
# Torify binary that works with custom Tor SOCKS addresses
# Related issue: https://github.com/NixOS/nixpkgs/issues/94236
torify = mkOption {
readOnly = true;
default = pkgs.writers.writeBashBin "torify" ''
${pkgs.tor}/bin/torify \
--address ${config.services.tor.client.socksListenAddress.addr} \
"$@"
'';
defaultText = "(See source)";
};
# A helper for using doas instead of sudo when doas is enabled
runAsUserCmd = mkOption {
readOnly = true;
default = if config.security.doas.enable
then "doas -u"
else "sudo -u";
defaultText = "(See source)";
};
};
};
}