-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (50 loc) · 1.72 KB
/
Copy pathflake.nix
File metadata and controls
60 lines (50 loc) · 1.72 KB
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
{
description = "Sandwich";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-25.05";
inputs.nixpkgsMaster.url = "github:NixOS/nixpkgs/master";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, nixpkgsMaster, flake-utils }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs { inherit system; };
pkgsMaster = import nixpkgsMaster { inherit system; };
ghcName = "ghc9124";
compilers = {
ghc8107 = pkgs.haskell.compiler.ghc8107;
ghc902 = pkgs.haskell.compiler.ghc902;
ghc967 = pkgsMaster.haskell.compiler.ghc967;
ghc984 = pkgsMaster.haskell.compiler.ghc984;
ghc9124 = pkgsMaster.haskell.compiler.ghc9124;
};
mkDevShell = ghc: pkgs.mkShell {
buildInputs = (with pkgs; [
nodejs
gmp
ncurses
pcre
pkg-config
postgresql
zlib
]) ++ [
ghc
pkgsMaster.stack
pkgsMaster.cabal-install
pkgsMaster.hlint
];
};
in
{
packages = {
inherit (pkgsMaster) node2nix;
inherit (pkgsMaster.haskell.packages.${ghcName}) weeder;
test = pkgs.writeShellScriptBin "stack-test" ''
export NIX_PATH=nixpkgs=${pkgs.path}
${pkgsMaster.stack}/bin/stack test
'';
nixpkgsPath = pkgs.writeShellScriptBin "nixpkgsPath.sh" "echo -n ${pkgs.path}";
};
devShells = (builtins.mapAttrs (_: mkDevShell) compilers) // {
default = mkDevShell compilers.${ghcName};
};
});
}