mirror of
https://github.com/grin-compiler/grin.git
synced 2024-10-26 08:41:51 +03:00
commit
f5de24d041
35
flake.nix
35
flake.nix
@ -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";
|
||||
};
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user