-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
44 lines (39 loc) · 1.71 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
let
sources = import ./nix/sources.nix;
# Fetch the latest haskell.nix and import its default.nix
haskellNix = import sources."haskell.nix" {};
# haskell.nix provides access to the nixpkgs pins which are used by our CI, hence
# you will be more likely to get cache hits when using these.
# But you can also just use your own, e.g. '<nixpkgs>'
#nixpkgsSrc = if haskellNix.pkgs.stdenv.hostPlatform.isDarwin then sources.nixpkgs-darwin else haskellNix.sources.nixpkgs-2305;
# no need to check platform now
nixpkgsSrc = haskellNix.sources.nixpkgs-2305;
# haskell.nix provides some arguments to be passed to nixpkgs, including some patches
# and also the haskell.nix functionality itself as an overlay.
nixpkgsArgs = haskellNix.nixpkgsArgs;
in
{ nativePkgs ? import nixpkgsSrc (nixpkgsArgs // { overlays = nixpkgsArgs.overlays ++ [(import ./nix/overlay)]; })
, haskellCompiler ? "ghc928"
, customModules ? []
}:
let pkgs = nativePkgs;
in
# 'cabalProject' generates a package set based on a cabal.project (and the corresponding .cabal files)
rec {
# inherit the pkgs package set so that others importing this function can use it
inherit pkgs;
# nativePkgs.lib.recurseIntoAttrs, just a bit more explicilty.
recurseForDerivations = true;
propellor = (pkgs.haskell-nix.project {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "propellor";
src = ./.;
};
projectFileName = "cabal.project";
index-state = pkgs.haskell-nix.internalHackageIndexState;
compiler-nix-name = haskellCompiler;
modules = customModules;
});
propellor-exe = propellor.propellor.components.exes.propellor-config;
#propellor-test = propellor.propellor.components.tests.propellor-test;
}