forked from Yehowshua/RiscV-Formal
65 lines
1.8 KiB
Nix
65 lines
1.8 KiB
Nix
![]() |
{
|
||
|
inputs = {
|
||
|
nixpkgs = {
|
||
|
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||
|
};
|
||
|
utils.url = "github:numtide/flake-utils";
|
||
|
haskellNix.url = "github:input-output-hk/haskell.nix";
|
||
|
|
||
|
};
|
||
|
|
||
|
outputs =
|
||
|
inputs:
|
||
|
inputs.utils.lib.eachDefaultSystem (
|
||
|
system:
|
||
|
let
|
||
|
pkgs = import inputs.nixpkgs {
|
||
|
localSystem = system;
|
||
|
overlays = [
|
||
|
inputs.haskellNix.overlay
|
||
|
(_: prev: {
|
||
|
riscv-formal = prev.callPackage (
|
||
|
{
|
||
|
haskell-nix,
|
||
|
qemu,
|
||
|
}:
|
||
|
haskell-nix.hix.project {
|
||
|
src = builtins.path {
|
||
|
path = ./.;
|
||
|
name = "riscv-formal-source";
|
||
|
};
|
||
|
shell =
|
||
|
let
|
||
|
riscv64-linux = prev.pkgsCross.riscv64-embedded.__splicedPackages;
|
||
|
in
|
||
|
{
|
||
|
tools = {
|
||
|
cabal = { };
|
||
|
hlint = { };
|
||
|
haskell-language-server = { };
|
||
|
};
|
||
|
nativeBuildInputs = [
|
||
|
qemu
|
||
|
riscv64-linux.gcc
|
||
|
riscv64-linux.binutils
|
||
|
riscv64-linux.glibc
|
||
|
];
|
||
|
};
|
||
|
}
|
||
|
) { };
|
||
|
})
|
||
|
];
|
||
|
};
|
||
|
flake = pkgs.riscv-formal.flake { };
|
||
|
in
|
||
|
flake
|
||
|
);
|
||
|
|
||
|
nixConfig = {
|
||
|
# https://input-output-hk.github.io/haskell.nix/tutorials/getting-started-flakes.html#setting-up-the-binary-cache
|
||
|
extra-substituters = [ "https://cache.iog.io" ];
|
||
|
extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||
|
allow-import-from-derivation = true;
|
||
|
};
|
||
|
}
|