-
Notifications
You must be signed in to change notification settings - Fork 30
/
flake.nix
77 lines (72 loc) · 2 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
inputs = {
nix-eda.url = github:efabless/nix-eda;
quaigh = {
url = github:coloquinte/quaigh;
inputs.nixpkgs.follows = "nix-eda/nixpkgs";
};
nl2bench = {
url = github:donn/nl2bench;
inputs.nix-eda.follows = "nix-eda";
inputs.quaigh.follows = "quaigh";
};
};
outputs = {
self,
nix-eda,
quaigh,
nl2bench,
...
}: let
nixpkgs = nix-eda.inputs.nixpkgs;
lib = nixpkgs.lib;
in {
overlays = {
default = lib.composeManyExtensions [
(nix-eda.flakesToOverlay [quaigh])
nl2bench.overlays.default
(pkgs': pkgs: let
callPackage = lib.callPackageWith pkgs';
in {
atalanta = callPackage ./nix/atalanta.nix {};
podem = callPackage ./nix/podem.nix {};
fault = callPackage ./default.nix {};
})
];
};
legacyPackages = nix-eda.forAllSystems (
system:
import nixpkgs {
inherit system;
overlays = [nix-eda.overlays.default self.overlays.default];
}
);
packages = nix-eda.forAllSystems (system: {
inherit (self.legacyPackages.${system}) atalanta podem fault;
default = self.packages.${system}.fault;
});
devShells = nix-eda.forAllSystems (
system: let
pkgs = self.legacyPackages."${system}";
callPackage = lib.callPackageWith pkgs;
in {
mac-testing = pkgs.stdenvNoCC.mkDerivation (with pkgs; let
pyenv = python3.withPackages (ps: with ps; [pyverilog pyyaml pytest nl2bench]);
in {
# Use the host's Clang and Swift
name = "shell";
buildInputs = [
yosys
verilog
pkgs.quaigh
pyenv
gtkwave
];
PYTHON_LIBRARY = "${pyenv}/lib/lib${python3.libPrefix}${stdenvNoCC.hostPlatform.extensions.sharedLibrary}";
PYTHONPATH = "${pyenv}/${pyenv.sitePackages}";
FAULT_IVL_BASE = "${verilog}/lib/ivl";
});
}
);
};
}