Skip to content

Instantly share code, notes, and snippets.

## Build a Nix derivation without binary cache substitution
# Use a separate, temporary Nix store, so we can debug derivations that are already
# available in the main store
store="--store /tmp/store"
sudo rm -rf /tmp/store
# Fetch all build deps from the binary cache
nix print-dev-env $store --substitute myflake#output >/dev/null
#!/usr/bin/env bash
read -rd '' script <<'EOF' || :
import sys
from fontTools import ttLib
path = sys.argv[1]
font = ttLib.TTFont(path)
del font['trak']
font.save(sys.stdout.buffer)

The basic recipe for deploying a nix-bitcoin VM

  • Create a new nix-bitcoin node config
  • Deploy the packer NixOS base image
  • Deploy the nix-bitcoin node config.
    You should use a NixOS deployment method that includes local building.
    In this way, common build components are cached on your main dev system so that new nodes can be built very quickly.
    One possible method:
    • Add nix-bitcoin.setupSecrets = true; to the node config
  • For deploying:
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
index b7b01f9ce68..59da373f38e 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
@@ -1653,36 +1653,6 @@ Superuser created successfully.
</listitem>
</itemizedlist>
</listitem>
- <listitem>
- <para>
{ config, pkgs, lib, ... }:
with lib;
let
options = {
nix-bitcoin.customGateway = {
services = mkOption {
type = with types; listOf str;
default = [];
example = [ "bitcoind" "electrs" ];
#! /usr/bin/env bash
set -euo pipefail
vm=$(nix-build --show-trace --no-out-link - <<'EOF'
let
# https://github.com/fort-nix/nix-bitcoin/issues/241
nbConfig = { config, pkgs, lib, ... }:
let
nix-bitcoin = builtins.fetchTarball {
vm=$(nix-build --no-out-link - <<'EOF'
let
# https://github.com/fort-nix/nix-bitcoin/issues/241
nbConfig = { config, pkgs, lib, ... }:
let
nix-bitcoin = fetchGit rec {
url = https://github.com/fort-nix/nix-bitcoin.git;
ref = "master";
rev = "43cac9d35e94f58c615aa9bd71e46310ddf17ab8";
vm=$(nix-build --no-out-link - <<'EOF'
let
nbConfig = { config, pkgs, lib, ... }:
let
nix-bitcoin = fetchGit rec {
url = https://github.com/fort-nix/nix-bitcoin.git;
ref = "master";
rev = "43cac9d35e94f58c615aa9bd71e46310ddf17ab8";
name = "nix-bitcoin-${rev}";
};
vm=$(nix-build --no-out-link - <<'EOF'
(import <nixpkgs/nixos> {
configuration = { pkgs, lib, ... }: with lib; {
users.users.me.isNormalUser = true;
services.xserver = {
enable = true;
desktopManager.xterm.enable = true;
displayManager.lightdm = {
enable = true;
autoLogin.enable = true;
#!/usr/bin/env bash
set -euo pipefail
instantiateTest() {
test/run-tests.sh vmTestNixExpr | nix-instantiate --indirect --add-root $1 - > /dev/null
}
TMPDIR=/tmp/diff-vm-drv
mkdir -p $TMPDIR