Add initial flake
This commit is contained in:
parent
d552934b95
commit
0dd4b60b70
3 changed files with 130 additions and 14 deletions
69
flake.nix
Normal file
69
flake.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs:
|
||||
inputs.utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
localSystem = system;
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
|
||||
riscv-bluespec-classic = pkgs.callPackage (
|
||||
{
|
||||
stdenv,
|
||||
bluespec,
|
||||
nextpnr,
|
||||
openfpgaloader,
|
||||
trellis,
|
||||
which,
|
||||
yosys,
|
||||
TOPMODULE ? "mkTop",
|
||||
makeFlags ? [ ],
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "riscv-bluespec-classic";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
|
||||
# Versions can be checked with
|
||||
# `nix eval --json ".#bluespec-joh-template.nativeBuildInputs" | nix-shell -p jq --run jq`
|
||||
nativeBuildInputs = [
|
||||
bluespec
|
||||
nextpnr
|
||||
openfpgaloader
|
||||
trellis
|
||||
which
|
||||
yosys
|
||||
];
|
||||
|
||||
# TODO: Build and install something
|
||||
|
||||
}
|
||||
) { };
|
||||
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = inputs.self.packages."${system}".riscv-bluespec-classic;
|
||||
riscv-bluespec-classic = pkgs.riscv-bluespec-classic;
|
||||
};
|
||||
|
||||
devShells.default =
|
||||
with pkgs;
|
||||
mkShell {
|
||||
inputsFrom = [ riscv-bluespec-classic ];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Reference in a new issue