forked from gatecat/nextpnr-xilinx
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathflake.nix
48 lines (45 loc) · 1.43 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
# run this flake like this to get a devshell for compiling nextpnr-xilinx:
# nix develop .
{
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/24.05";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils, ... }:
let
# System types to support.
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
# devshell for building nextpnr-xilinx
devShell = forAllSystems (system:
let nixpkgs = nixpkgsFor.${system};
in nixpkgs.mkShell {
buildInputs = (with nixpkgsFor.${system}; [
findutils
gnused
gnugrep
coreutils
gnumake
python312
python312Packages.boost
cmake
gcc
boost
bzip2
lzma
zstd
eigen
]);
shellHook =
nixpkgs.lib.concatStrings [
"export CC=" nixpkgs.gcc "/bin/gcc\n"
"export CXX=" nixpkgs.gcc "/bin/g++\n"
];
}
);
};
}