-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
61 lines (55 loc) · 1.74 KB
/
flake.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
55
56
57
58
59
60
61
{
description = "ghc-dev";
inputs = {
terranix = {
url = "github:terranix/terranix";
inputs.nixpkgs.follows = "nixpkgs";
};
serokell-nix = {
url = "github:serokell/serokell.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, serokell-nix, terranix }:
let
system = "x86_64-linux";
ghc = "ghc92";
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages =
pkgs.haskell.packages.${ghc}.extend(hself: hsuper: {
ghc-dev-webgen = haskellPackages.callCabal2nix "ghc-dev-webgen" "${self}/src/" {};
});
tfConfigAst = terranix.lib.terranixConfigurationAst {
inherit system pkgs;
modules = [ ./deployment/main.nix ];
};
tfLib = serokell-nix.lib.terraform { inherit pkgs tfConfigAst; };
in
{
packages.${system} = {
ghc-dev-webgen = haskellPackages.ghc-dev-webgen;
ghc-dev =
pkgs.stdenv.mkDerivation {
name = "ghc-dev";
buildCommand = ''
mkdir -p "$out/out"
"${haskellPackages.ghc-dev-webgen}"/bin/ghc-dev-webgen "$out/out"
'';
};
};
defaultPackage.${system} = self.packages.${system}.ghc-dev;
devShell.${system} = pkgs.mkShell {
buildInputs = [
(haskellPackages.ghcWithPackages(p: p.ghc-dev-webgen.getCabalDeps.executableHaskellDepends))
haskellPackages.ghc-dev-webgen.getCabalDeps.executableToolDepends
haskellPackages.hie-bios
haskellPackages.haskell-language-server
haskellPackages.cabal-install
];
};
# nix run .#tf-plan
# nix run .#tf-apply
apps.${system} = tfLib.mkApps [ "plan" "apply" ];
};
}