Merge pull request #120 from yatima-inc/master

Fix flake.nix too
This commit is contained in:
Csaba Hruska 2021-05-07 19:07:32 +02:00 committed by GitHub
commit f5de24d041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,22 +10,39 @@
outputs = { self, nixpkgs, flake-utils, haskellNix }:
flake-utils.lib.eachDefaultSystem (system:
let
llvm-overlay = self: super: {
llvm-config = self.llvm_7;
GRIN_CC = "${pkgs.clang_7}/bin/clang";
GRIN_OPT = "${pkgs.llvm_7}/bin/opt";
GRIN_LLC = "${pkgs.llvm_7}/bin/llc";
};
overlays = [ haskellNix.overlay
(final: prev: {
# This overlay adds our project to pkgs
grinProject =
final.haskell-nix.project' {
final.haskell-nix.stackProject' {
name = "grin";
src = ./.;
compiler-nix-name = "ghc8104";
compiler-nix-name = "ghc865";
};
})
llvm-overlay
];
pkgs = import nixpkgs { inherit system overlays; };
flake = pkgs.grinProject.flake {};
packageName = "grin";
executable = "grin:exe:grin";
app = flake-utils.lib.mkApp {
name = "grin";
exePath = "/bin/grin";
drv = self.packages.${system}.${executable};
};
in flake // {
# Built by `nix build .`
defaultPackage = flake.packages."grin:exe:grin";
defaultPackage = flake.packages.${executable};
# `nix run`
apps.grin = app;
defaultApp = app;
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
@ -34,12 +51,12 @@
cabal = "latest";
hlint = "latest";
haskell-language-server = "latest";
# Env
GRIN_CC = "${pkgs.clang_7}/bin/clang";
GRIN_OPT = "${pkgs.llvm_7}/bin/opt";
GRIN_LLC = "${pkgs.llvm_7}/bin/llc";
};
# Env
GRIN_CC = "${pkgs.clang_7}/bin/clang";
GRIN_OPT = "${pkgs.llvm_7}/bin/opt";
GRIN_LLC = "${pkgs.llvm_7}/bin/llc";
};
}
);