Skip to content

Commit 0a99231

Browse files
committed
Update README.md
Updates the readme to include chapter about the Nix cache
1 parent 97ff9bc commit 0a99231

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,33 @@ This project exposes several Nix flake outputs. Most notibly the `clash-protocol
619619

620620
Contributing to `clash-protocols` can be done via the developer shell exposed by the Nix flake. Open a terminal and typing: `nix develop`. Optionally a specific GHC version can be selected as well as a `-minimal` or `-full` version. The `-minimal` shell does **NOT** contain the Haskell Language Server, whilst the `-full` shell does. When using the developer shell, do not forget to remove the `cabal.project` file. This file contains a package source and Cabal prioritizes local package sources over Nix sources. Removing the `cabal.project` file should work fine when developing with Nix.
621621

622+
Compiling Clash and all dependencies related to it may take a long time. To remidy long compilation times, you can make use of the publically available cache on Cachix:
623+
624+
## Cachix (binary cache)
625+
626+
Cachix contains all commits on the main branch of `clash-cores` since the cache has been setup. It is recommended to add the publically available cachix cache to your project/computer to minimize the amount of time manually compiling Clash related dependencies.
627+
628+
You can either add user-wide on your local system via `nix.conf` (usually located under `~/.config/nix`, create it if it does not exist):
629+
```conf
630+
extra-substituters = https://clash-lang.cachix.org
631+
extra-trusted-public-keys = clash-lang.cachix.org-1:/2N1uka38B/heaOAC+Ztd/EWLmF0RLfizWgC5tamCBg=
632+
```
633+
634+
Or as part of your `flake.nix` in your local project:
635+
```nix
636+
{
637+
nixConfig = {
638+
extra-substituters = [ "https://clash-lang.cachix.org" ];
639+
extra-trusted-public-keys = [ "clash-lang.cachix.org-1:/2N1uka38B/heaOAC+Ztd/EWLmF0RLfizWgC5tamCBg=" ];
640+
};
641+
description = ...;
642+
inputs = ...;
643+
outputs = ...;
644+
}
645+
```
646+
647+
## As a dependency
648+
622649
You can also add this project as a Nix-dependency. This project depends on `clash-compiler`, the recommended way to add this to your project as a Nix dependency is as follows:
623650

624651
First add `clash-compiler` and `clash-protocols` to your flake inputs:

0 commit comments

Comments
 (0)