-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
81 lines (74 loc) · 2.68 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
78
79
80
81
{
description = "circt-y things";
inputs = {
# Use Nixpkgs branch until MLIR at least is merged into nixpkgs proper
nixpkgs.url = "github:dtzWill/nixpkgs/mlir-master";
circt-src.url = "github:llvm/circt";
circt-src.flake = false;
llvm-submodule-src = {
type = "github";
owner = "llvm";
repo = "llvm-project";
# From circt submodule
rev = "92663defb1c27d809f644752d65d8ccff93a7054";
flake = false;
};
slang-src.url = "github:MikePopoloski/slang";
slang-src.flake = false;
flake-utils.url = "github:numtide/flake-utils";
# From README.md: https://github.com/edolstra/flake-compat
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
};
outputs = { self
, nixpkgs
, flake-compat, flake-utils
, circt-src, llvm-submodule-src
, slang-src
}: flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system};
newLLVMPkgs = pkgs.callPackage ./llvm.nix {
inherit llvm-submodule-src;
llvmPackages = pkgs.llvmPackages_git;
};
in rec {
devShells = {
default = import ./shell.nix { inherit pkgs; };
} // pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin /* libcxxabi git on Darwin is broken?*/) {
git = import ./shell.nix {
inherit pkgs;
llvmPkgs = pkgs.llvmPackages_git; # NOT same as submodule.
};
};
packages = flake-utils.lib.flattenTree (newLLVMPkgs // rec {
default = circt; # default for `nix build` etc.
circt = pkgs.callPackage ./circt.nix {
inherit circt-src;
inherit (newLLVMPkgs) libllvm mlir llvm-third-party-src;
inherit lit;
slang = slang_3;
};
espresso = pkgs.callPackage ./espresso.nix {};
slang = pkgs.callPackage ./slang.nix {
inherit slang-src;
};
slang_3 = pkgs.callPackage ./slang_3.nix {};
# Patch for dyld library path setting in runner.
lit = pkgs.lit.overrideAttrs (o: {
patches = o.patches or [] ++ [
./patches/lit-shell-script-runner-set-dyld-library-path.patch
];
});
});
apps = pkgs.lib.genAttrs [ "firtool" "circt-lsp-server" ]
(name: flake-utils.lib.mkApp { drv = packages.circt; inherit name; });
}
);
nixConfig = {
extra-substituters = [ "https://dtz-circt.cachix.org" ];
extra-trusted-public-keys = [ "dtz-circt.cachix.org-1:PHe0okMASm5d9SD+UE0I0wptCy58IK8uNF9P3K7f+IU=" ];
};
}