-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathflake.nix
66 lines (54 loc) · 1.94 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
62
63
64
65
66
{
description = "aeson-typescript";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs";
outputs = { self, flake-utils, gitignore, haskellNix, nixpkgs }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
# compiler-nix-name = "ghc966";
compiler-nix-name = "ghc984";
pkgs = import nixpkgs {
inherit system;
overlays = [haskellNix.overlay];
inherit (haskellNix) config;
};
src = gitignore.lib.gitignoreSource ./.;
flake = (pkgs.haskell-nix.hix.project {
inherit src compiler-nix-name;
evalSystem = system;
projectFileName = "stack.yaml";
modules = [];
}).flake {};
flakeWindows = (pkgs.pkgsCross.mingwW64.haskell-nix.hix.project {
inherit src compiler-nix-name;
evalSystem = system;
projectFileName = "stack-9.8.4.yaml";
modules = [{
reinstallableLibGhc = false;
}];
}).flake {};
in
{
packages = {
inherit (pkgs.haskell.packages.${compiler-nix-name}) weeder;
inherit flake;
normal = flake.packages."aeson-typescript:lib:aeson-typescript";
windows = flakeWindows.packages."aeson-typescript:lib:aeson-typescript";
test = pkgs.writeShellScriptBin "stack-test" ''
export NIX_PATH=nixpkgs=${pkgs.path}
${pkgs.stack}/bin/stack test
'';
nixpkgsPath = pkgs.writeShellScriptBin "nixpkgsPath.sh" "echo -n ${pkgs.path}";
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nodePackages.typescript
];
};
});
}