Skip to content

Commit d768634

Browse files
committed
Update Nix infrastructure
The Nix infrastructure of the current project is broken and does not compile. Rather than fixing it, I rewrote it entirely using nix flakes instead.
1 parent 564769c commit d768634

File tree

8 files changed

+247
-106
lines changed

8 files changed

+247
-106
lines changed

default.nix

Lines changed: 0 additions & 16 deletions
This file was deleted.

flake.lock

Lines changed: 197 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
description = "A flake for developing & using circuit-notation";
3+
inputs = {
4+
clash-compiler.url = "github:clash-lang/clash-compiler";
5+
};
6+
outputs = { self, flake-utils, clash-compiler, ... }:
7+
flake-utils.lib.eachDefaultSystem (system:
8+
let
9+
# What version of the GHC compiler to use
10+
compiler-version = "ghc910";
11+
12+
pkgs = (import clash-compiler.inputs.nixpkgs {
13+
inherit system;
14+
}).extend clash-compiler.overlays.${compiler-version};
15+
clash-pkgs = pkgs."clashPackages-${compiler-version}";
16+
17+
overlay = final: prev: clash-pkgs // {
18+
circuit-notation = prev.developPackage {
19+
root = ./.;
20+
overrides = overlay;
21+
};
22+
};
23+
24+
hs-pkgs = pkgs."clashPackages-${compiler-version}".extend overlay;
25+
in
26+
{
27+
# Expose the set of haskell packages used to build circuit-notation, so that dependants can
28+
# use the same set of packages
29+
hs-pkgs.${compiler-version} = hs-pkgs;
30+
31+
devShells.default = hs-pkgs.shellFor {
32+
packages = p: [
33+
p.circuit-notation
34+
];
35+
36+
nativeBuildInputs =
37+
[
38+
# Haskell stuff
39+
hs-pkgs.cabal-install
40+
hs-pkgs.cabal-plan
41+
hs-pkgs.haskell-language-server
42+
hs-pkgs.fourmolu
43+
]
44+
;
45+
};
46+
packages = {
47+
default = hs-pkgs.circuit-notation;
48+
};
49+
});
50+
}

nix/ghcid.nix

Lines changed: 0 additions & 9 deletions
This file was deleted.

nix/nixpkgs.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

nix/nixpkgs.nix

Lines changed: 0 additions & 8 deletions
This file was deleted.

nix/update-nixpkgs.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

shell.nix

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)