Add flake
`haskell.nix` is quite different from normal nix infra but seems to be working fine here. Works with ghc 9.6.6
This commit is contained in:
parent
ad34d49f3d
commit
fec992cf2a
3 changed files with 643 additions and 16 deletions
66
flake.nix
Normal file
66
flake.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
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 {
|
||||
compiler-nix-name = "ghc948";
|
||||
# This works
|
||||
#compiler-nix-name = "ghc966";
|
||||
src = builtins.path {
|
||||
path = ./.;
|
||||
name = "riscv-formal-source";
|
||||
};
|
||||
shell =
|
||||
let
|
||||
riscv64-linux = prev.pkgsCross.riscv64-embedded.__splicedPackages;
|
||||
in
|
||||
{
|
||||
tools = {
|
||||
cabal = { };
|
||||
hlint = { };
|
||||
};
|
||||
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;
|
||||
};
|
||||
}
|
Reference in a new issue