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>
This commit is contained in:
@@ -1,135 +1,27 @@
|
||||
{
|
||||
description = ''
|
||||
A collection of Nix packages and NixOS modules for easily
|
||||
installing full-featured Bitcoin nodes with an emphasis on security.
|
||||
NixOS modules for a Bitcoin node (bitcoind, lnd, electrs, mempool),
|
||||
trimmed from fort-nix/nix-bitcoin.
|
||||
'';
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs-25_05.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
extra-container = {
|
||||
url = "github:erikarvstedt/extra-container/0.14";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-25_05, flake-utils, ... }:
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
# On these 32-bit platforms, Python pkg `pymemcache` 4.0.0 (required by
|
||||
# `joinmarket`) is broken:
|
||||
# "i686-linux"
|
||||
# "armv7l-linux"
|
||||
];
|
||||
|
||||
test = import ./test/tests.nix nixpkgs.lib self.nixosModules.default;
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems
|
||||
(system: f nixpkgs.legacyPackages.${system});
|
||||
in {
|
||||
lib = {
|
||||
mkNbPkgs = {
|
||||
system
|
||||
, pkgs ? nixpkgs.legacyPackages.${system}
|
||||
, pkgsUnstable ? nixpkgs-unstable.legacyPackages.${system}
|
||||
, pkgs-25_05 ? nixpkgs-25_05.legacyPackages.${system}
|
||||
}:
|
||||
import ./pkgs { inherit pkgs pkgsUnstable pkgs-25_05; };
|
||||
nixosModules.default = ./modules/modules.nix;
|
||||
|
||||
test = {
|
||||
inherit (test) scenarios;
|
||||
};
|
||||
overlays.default = final: prev: import ./pkgs { pkgs = final; };
|
||||
|
||||
inherit supportedSystems;
|
||||
};
|
||||
|
||||
overlays.default = final: prev: let
|
||||
nbPkgs = self.lib.mkNbPkgs { inherit (final) system; pkgs = final; };
|
||||
in removeAttrs nbPkgs [ "pinned" "nixops19_09" "krops" ];
|
||||
|
||||
nixosModules.default = { config, pkgs, lib, ... }: {
|
||||
imports = [ ./modules/modules.nix ];
|
||||
|
||||
options = with lib; {
|
||||
nix-bitcoin.useVersionLockedPkgs = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Use the nixpkgs version locked by this flake for `nix-bitcoin.pkgs`.
|
||||
Only relevant if you are using a nixpkgs version for evaluating your system
|
||||
that differs from the one that is locked by this flake (via input `nixpkgs`).
|
||||
If this is the case, enabling this option may result in a more stable system
|
||||
because the nix-bitcoin services use the exact pkgs versions that are tested
|
||||
by nix-bitcoin.
|
||||
The downsides are increased evaluation times and increased system
|
||||
closure size.
|
||||
|
||||
If `false`, the default system pkgs are used.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
nix-bitcoin.pkgs =
|
||||
if config.nix-bitcoin.useVersionLockedPkgs
|
||||
then (self.lib.mkNbPkgs { inherit (config.nixpkgs) system; }).modulesPkgs
|
||||
else (self.lib.mkNbPkgs { inherit (pkgs.stdenv.hostPlatform) system; inherit pkgs; }).modulesPkgs;
|
||||
};
|
||||
};
|
||||
|
||||
templates.default = {
|
||||
description = "Basic node template";
|
||||
path = ./examples/flakes;
|
||||
};
|
||||
|
||||
} // (flake-utils.lib.eachSystem supportedSystems (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
nbPkgs = self.lib.mkNbPkgs { inherit system pkgs; };
|
||||
in rec {
|
||||
packages = flake-utils.lib.flattenTree (removeAttrs nbPkgs [
|
||||
"fetchNodeModules"
|
||||
"krops"
|
||||
"modulesPkgs"
|
||||
"netns-exec"
|
||||
"nixops19_09"
|
||||
"pinned"
|
||||
"generate-secrets"
|
||||
"nbPython3Packages"
|
||||
"nbPython3PackagesJoinmarket"
|
||||
]) // {
|
||||
inherit (import ./examples/qemu-vm/minimal-vm.nix self pkgs system)
|
||||
# A simple demo VM.
|
||||
# See ./examples/flakes/flake.nix on how to use nix-bitcoin with flakes.
|
||||
runVM
|
||||
vm;
|
||||
};
|
||||
|
||||
# Allow accessing the whole nested `nbPkgs` attrset (including `modulesPkgs`)
|
||||
# via this flake.
|
||||
# `packages` is not allowed to contain nested pkgs attrsets.
|
||||
legacyPackages =
|
||||
nbPkgs //
|
||||
(test.pkgs self pkgs) //
|
||||
{
|
||||
extra-container = self.inputs.extra-container.packages.${system}.default;
|
||||
|
||||
ciTestInfo = import ./test/ci/test-info.nix pkgs legacyPackages.instantiateTests;
|
||||
};
|
||||
|
||||
apps = rec {
|
||||
default = vm;
|
||||
|
||||
# Run a basic nix-bitcoin node in a VM
|
||||
vm = {
|
||||
type = "app";
|
||||
program = toString packages.runVM;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = import ./dev/dev-env/dev-shell.nix pkgs;
|
||||
}
|
||||
));
|
||||
packages = forAllSystems (pkgs: {
|
||||
inherit (import ./pkgs { inherit pkgs; })
|
||||
mempool-backend
|
||||
mempool-frontend
|
||||
mempool-rust-gbt
|
||||
mempool-nginx-conf;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user