forked from nix-ocaml/nix-overlays
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
80 lines (74 loc) · 2.1 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
description = "ocaml-packages-overlay";
nixConfig = {
extra-substituters = "https://anmonteiro.nix-cache.workers.dev";
extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?rev=4c547b66635455ad061d4beecaf1805810dc0428";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
let
overlay = import ./overlay nixpkgs;
in
nixpkgs.lib.recursiveUpdate
{
lib = nixpkgs.lib;
hydraJobs = builtins.listToAttrs (
map
(system: {
name = system;
value = import ./ci/hydra.nix {
inherit system;
pkgs = self.legacyPackages.${system};
};
})
[
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
);
makePkgs =
{
system,
extraOverlays ? [ ],
...
}@attrs:
let
pkgs = import nixpkgs (
{
inherit system;
overlays = [ overlay ];
config =
{
allowUnfree = true;
}
// nixpkgs.lib.optionalAttrs (system == "x86_64-darwin") {
config.replaceStdenv = { pkgs, ... }: pkgs.clang11Stdenv;
};
}
// attrs
);
in
/*
You might read
https://nixos.org/manual/nixpkgs/stable/#sec-overlays-argument and
want to change this but because of how we're doing overlays we will
be overriding any extraOverlays if we don't use `appendOverlays`
*/
pkgs.appendOverlays extraOverlays;
overlays.default = final: prev: overlay final prev;
}
(
flake-utils.lib.eachDefaultSystem (system: {
legacyPackages = self.makePkgs { inherit system; };
})
);
}