You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ A battery-included library for writing on-chip protocols, such as AMBA AXI and A
22
22
-[License](#license)
23
23
-[Project goals](#project-goals)
24
24
-[Contributing](#contributing)
25
+
-[Nix](#nix)
25
26
-[TODO](#todo)
26
27
27
28
# Introduction
@@ -613,6 +614,59 @@ This project does not aim to:
613
614
# Contributing
614
615
No formal guidelines yet, but feel free to open a PR!
615
616
617
+
# Nix
618
+
This project exposes several Nix flake outputs.Most notibly the `clash-protocols` and `clash-protocols-base` packages themselves.These packages are exposed individually, or as an overlay (which you need to apply on top of clash-compiler).
619
+
620
+
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 HaskellLanguageServer, whilst the `-full` shell does.When using the developer shell, donot forget to remove the `cabal.project` file.This file contains a package source andCabal prioritizes local package sources over Nix sources.Removing the `cabal.project` file should work fine when developing with Nix.
621
+
622
+
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:
623
+
624
+
First add `clash-compiler` and `clash-protocols` to your flake inputs:
It is important to have clash-protocols follow the same clash-compiler version as your project, this ensures you do not get different Haskell package hashes. Afterwards, use the `clashPackages` as a baseline for your Haskell packages and overlay this project's overlay ontop of it:
636
+
637
+
```nix
638
+
let
639
+
# The GHC version you would like to use
640
+
# This has to be be one of the supported versions of clash-compiler
641
+
clash-compiler = "ghc9101";
642
+
643
+
# Import the normal and Haskell package set from clash-protocols
0 commit comments