-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdefault.nix
54 lines (49 loc) · 1.37 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
44
45
46
47
48
49
50
51
52
53
54
{ forShell ? false }:
with import ./nix;
with builtins;
let
# Set of package sources parsed from cabal.project.
targets =
import ./nix/cabal.nix;
# Add local packages to haskellPackages.
localHaskellPackages =
haskellPackages.extend (haskell.lib.packageSourceOverrides targets);
# Set of local packages, built from targets.
packages =
mapAttrs (name: _: localHaskellPackages.${name}) targets;
# Shell for developing the local packages. Includes Haskell dependencies and
# Elm tools. Elm dependencies are managed by Elm itself, and used with Nix by
# applying elm2nix.
shell =
localHaskellPackages.shellFor
{
packages = _: attrValues packages;
withHoogle = true;
buildInputs =
[
# Haskell
localHaskellPackages.ghc
localHaskellPackages.cabal-install
localHaskellPackages.ghcid
localHaskellPackages.ormolu
# Elm
elmPackages.elm
elmPackages.elm-analyse
elmPackages.elm-doc-preview
elm2nix
nodePackages.uglify-js
# Database
docker-compose
postgresql
# Deployment
flyctl
# IPFS
ipfs
# Majority Consensus
majority-consensus
];
};
in
if forShell
then shell
else packages