Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 libc,
4 config,
5 system,
6 bootstrapFiles,
7 isFromBootstrapFiles ? false,
8}:
9
10let
11 maybeDenoteProvenance = lib.optionalAttrs isFromBootstrapFiles {
12 passthru = {
13 inherit isFromBootstrapFiles;
14 };
15 };
16
17 maybeContentAddressed = lib.optionalAttrs config.contentAddressedByDefault {
18 __contentAddressed = true;
19 outputHashAlgo = "sha256";
20 outputHashMode = "recursive";
21 };
22
23 args = {
24 inherit system bootstrapFiles;
25 extraAttrs = maybeContentAddressed;
26 };
27 result =
28 if libc == "glibc" then
29 import ./glibc.nix args
30 else if libc == "musl" then
31 import ./musl.nix args
32 else
33 throw "unsupported libc";
34in
35result // maybeDenoteProvenance