-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env nix-shell | ||
# When using as a callable script, passing `--argstr path some/path` overrides $PWD. | ||
#!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true --argstr path $PWD -f" | ||
{ | ||
checkMeta, | ||
path ? ./.., | ||
supportedSystems ? [ | ||
"aarch64-linux" | ||
"aarch64-darwin" | ||
"x86_64-linux" | ||
"x86_64-darwin" | ||
], | ||
}: | ||
let | ||
lib = import (path + "/lib"); | ||
hydraJobs = | ||
import (path + "/pkgs/top-level/release.nix") | ||
# Compromise: accuracy vs. resources needed for evaluation. | ||
{ | ||
inherit supportedSystems; | ||
|
||
nixpkgsArgs = { | ||
config = { | ||
allowAliases = false; | ||
allowBroken = true; | ||
allowUnfree = true; | ||
allowInsecurePredicate = x: true; | ||
checkMeta = checkMeta; | ||
|
||
handleEvalIssue = | ||
reason: errormsg: | ||
let | ||
fatalErrors = [ | ||
"unknown-meta" | ||
"broken-outputs" | ||
]; | ||
in | ||
if builtins.elem reason fatalErrors then abort errormsg else true; | ||
|
||
inHydra = true; | ||
}; | ||
}; | ||
}; | ||
recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; }; | ||
|
||
# hydraJobs leaves recurseForDerivations as empty attrmaps; | ||
# that would break nix-env and we also need to recurse everywhere. | ||
tweak = lib.mapAttrs ( | ||
name: val: | ||
if name == "recurseForDerivations" then | ||
true | ||
else if lib.isAttrs val && val.type or null != "derivation" then | ||
recurseIntoAttrs (tweak val) | ||
else | ||
val | ||
); | ||
|
||
# Some of these contain explicit references to platform(s) we want to avoid; | ||
# some even (transitively) depend on ~/.nixpkgs/config.nix (!) | ||
blacklist = [ | ||
"tarball" | ||
"metrics" | ||
"manual" | ||
"darwin-tested" | ||
"unstable" | ||
"stdenvBootstrapTools" | ||
"moduleSystem" | ||
"lib-tests" # these just confuse the output | ||
]; | ||
|
||
in | ||
tweak (builtins.removeAttrs hydraJobs blacklist) |