Skip to content

Commit

Permalink
Merge pull request #636 from onekey-sec/flake-nix-config
Browse files Browse the repository at this point in the history
Advertise binary cache for flake users
  • Loading branch information
vlaci authored Aug 4, 2023
2 parents 49cd963 + 79ed6cd commit fe1b17c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,21 @@ The Nix derivation installs all 3rd party dependencies.
1. _Optional_: enable the experimental features so that you don't need to pass
`--extra-experimental-features "nix-command flakes"` to `nix` command invocations:

mkdir -p ~/.config/nix
cat > ~/.config/nix/nix.conf <<EOF
experimental-features = nix-command flakes
EOF

1. _Optional_: use pre-built binaries from GitHub using [cachix](https://app.cachix.org/cache/unblob):

nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use unblob

1. Install unblob:

nix profile install github:onekey-sec/unblob
$ nix profile install github:onekey-sec/unblob
do you want to allow configuration setting 'extra-substituters' to be set to 'https://unblob.cachix.org' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to
'unblob.cachix.org-1:5kWA6DwOg176rSqU8TOTBXWxsDB4LoCMfGfTgL5qCAE=' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y

Using and trusting substituter (binary cache) and its public key is optional but greatly speeds up installation.

- Check that everything works correctly:

Expand Down
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
flake = false;
};

nixConfig = {
extra-substituters = [ "https://unblob.cachix.org" ];
extra-trusted-public-keys = [
"unblob.cachix.org-1:5kWA6DwOg176rSqU8TOTBXWxsDB4LoCMfGfTgL5qCAE="
];
};

outputs = { self, nixpkgs, filter, unblob-native, pyperscan, sasquatch, ... }:
let
# System types to support.
Expand Down

0 comments on commit fe1b17c

Please sign in to comment.