e658209d56run-tests.sh: fix building tests for Nix ≥ 2.15 (Erik Arvstedt)bb2e88cec2fix python packages for nixos 23.05 (Erik Arvstedt)e31cc686f2run-tests: make compatible with new shellcheck version (Erik Arvstedt)76dc7b92e1examples/deploy-container.sh: add extra-container version check (Erik Arvstedt)6c2d1108a4update the required extra-container version for nixos 23.05 (Erik Arvstedt)e2cce7daa8update to nixos 23.05 (Erik Arvstedt)55c64d8dffupdate nixpkgs (Erik Arvstedt)bd77b89feartl, clightning-rest: update to nodejs 18 (Erik Arvstedt) Pull request description: ACKs for top commit: jonasnick: ACKe658209d56Tree-SHA512: 5814f56e469ad384dfb81bc11f9ac256a35cd2647e7fd997b14f84927448fbb880b0b1cee3bdf5a2b926760b74aab291e901e67a0759d43ffaf705ff6b741b97
Examples
The easiest way to try out nix-bitcoin is to use one of the provided examples.
Flakes-based quick start
If you use a Flakes-enabled version of Nix, run the following command to start a minimal nix-bitcoin QEMU VM:
nix run github:fort-nix/nix-bitcoin/release
The VM (defined in flake.nix) runs in the terminal and has bitcoind
and clightning installed.
It leaves no traces (outside of /nix/store) on the host system.
More examples
Clone this repo and enter the examples shell:
git clone https://github.com/fort-nix/nix-bitcoin
cd nix-bitcoin/examples/
nix-shell
The following example scripts set up a nix-bitcoin node according to configuration.nix and then
shut down immediately. They leave no traces (outside of /nix/store) on the host system.
By default, configuration.nix enables bitcoind and clightning.
-
./deploy-container.shcreates a NixOS container.
This is the fastest way to set up a node.
Requires: Nix, a systemd-based Linux distro and root privileges -
./deploy-qemu-vm.shcreates a QEMU VM.
Requires: Nix, Linux -
./deploy-krops.shcreates a QEMU VM and deploys a nix-bitcoin configuration to it using krops.
Requires: Nix, Linux -
./deploy-container-minimal.shcreates a container defined by importable-configuration.nix.
You can copy and import this file to use nix-bitcoin in an existing NixOS configuration.
The configuration doesn't use the secure-node.nix preset.
Requires: Nix, a systemd-based Linux distro and root privileges
Run the examples with option --interactive or -i to start a shell for interacting with
the node:
./deploy-qemu-vm.sh -i
Tests
The nix-bitcoin test suite is also useful for exploring features.
Real-world example
Check the server repo for https://nixbitcoin.org to see the configuration of a Flakes-based nix-bitcoin node that's used in production.
The commands in shell.nix allow you to locally run the node in a VM or container.
Flakes
Flakes make it easy to include nix-bitcoin in an existing NixOS config.
The flakes example shows how to use nix-bitcoin as an input to a system flake.