Skip to content

Commit 7ce97de

Browse files
committed
docs(readme): Add info about using the Cachix binary cache
1 parent 4c2051c commit 7ce97de

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,44 @@ nix shell github:metacraft-labs/nix-blockchain-development#solana
2727

2828
```nix
2929
{
30+
# <after>:
31+
# Opt into `nix-blockchain-development`'s substituter (binary cache).
32+
# `nixConfig` settings are not transitive so every user of a flake with a
33+
# custom binary cache must manually include its `nixConfig` settings for
34+
# substituters and trusted public keys:
35+
nixConfig = {
36+
extra-substituters = "https://nix-blockchain-development.cachix.org";
37+
extra-trusted-public-keys = "nix-blockchain-development.cachix.org-1:Ekei3RuW3Se+P/UIo6Q/oAgor/fVhFuuuX5jR8K/cdg=";
38+
};
39+
3040
inputs = {
31-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
32-
flake-utils.url = github:numtide/flake-utils;
33-
mcl-blockchain.url = "github:metacraft-labs/nix-blockchain-development"; # <new>
34-
mcl-blockchain.inputs.nixpkgs.follows = "nixpkgs"; # <new>
35-
mcl-blockchain.inputs.flake-utils.follows = "flake-utils"; # <new>
41+
# <before>:
42+
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
43+
# flake-utils.url = github:numtide/flake-utils;
44+
45+
# <after>:
46+
# To ensure all packages from mcl-blockchain will be fetched from its
47+
# binary cache we need to ensure that we use exact same commit hash of the
48+
# inputs below. If we didn't, we may either:
49+
# * end up with multiple copies of the same package from nixpkgs
50+
# * be unable to use the binary cache, since the packages there where
51+
# using different versions of their dependencies from nixpkgs
52+
mcl-blockchain.url = "github:metacraft-labs/nix-blockchain-development";
53+
nixpkgs.follows = "mcl-blockchain/nixpkgs";
54+
flake-utils.follows = "mcl-blockchain/flake-utils";
3655
};
3756
3857
outputs = {
3958
self,
4059
nixpkgs,
4160
flake-utils,
42-
mcl-blockchain, # <new>
61+
mcl-blockchain, # <after>
4362
}:
4463
flake-utils.lib.simpleFlake {
4564
inherit self nixpkgs;
4665
name = "solana-hello-world";
4766
shell = ./shell.nix;
48-
preOverlays = [mcl-blockchain.overlays.default]; # <new>
67+
preOverlays = [mcl-blockchain.overlays.default]; # <after>
4968
};
5069
}
5170
```
@@ -57,7 +76,7 @@ nix shell github:metacraft-labs/nix-blockchain-development#solana
5776
with pkgs;
5877
mkShell {
5978
packages = [
60-
metacraft-labs.solana # <new>
79+
metacraft-labs.solana # <after>
6180
];
6281
}
6382
```

0 commit comments

Comments
 (0)