2010-02-05 17:14:43 +03:00
|
|
|
|
# Evaluate `release.nix' like Hydra would (i.e. call each job
|
|
|
|
|
# attribute with the expected `system' argument). Too bad
|
|
|
|
|
# nix-instantiate can't to do this.
|
|
|
|
|
|
2012-01-12 20:59:58 +04:00
|
|
|
|
with import ../../pkgs/lib;
|
2010-02-05 17:14:43 +03:00
|
|
|
|
|
2012-01-12 20:59:58 +04:00
|
|
|
|
let
|
2013-01-15 02:28:18 +04:00
|
|
|
|
trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y);
|
2010-02-05 17:14:43 +03:00
|
|
|
|
|
2010-08-19 16:37:10 +04:00
|
|
|
|
rel = removeAttrs (import ../../pkgs/top-level/release.nix) [ "tarball" "xbursttools" ];
|
2010-02-05 17:14:43 +03:00
|
|
|
|
|
2012-01-12 20:59:58 +04:00
|
|
|
|
seqList = xs: res: fold (x: xs: seq x xs) res xs;
|
2010-08-19 16:37:10 +04:00
|
|
|
|
|
2012-01-12 20:59:58 +04:00
|
|
|
|
strictAttrs = as: seqList (attrValues as) as;
|
2010-08-19 16:37:10 +04:00
|
|
|
|
|
2013-01-15 02:28:18 +04:00
|
|
|
|
maybe = as: let y = builtins.tryEval (strictAttrs as); in if y.success then y.value else builtins.trace "FAIL" {};
|
2010-02-05 17:14:43 +03:00
|
|
|
|
|
2012-01-12 20:59:58 +04:00
|
|
|
|
call = attrs: flip mapAttrs attrs
|
2012-01-24 23:10:54 +04:00
|
|
|
|
(n: v: trace n (
|
2011-10-27 20:50:00 +04:00
|
|
|
|
if builtins.isFunction v then maybe (v { system = "x86_64-linux"; })
|
2010-02-05 17:14:43 +03:00
|
|
|
|
else if builtins.isAttrs v then call v
|
|
|
|
|
else null
|
|
|
|
|
));
|
|
|
|
|
|
2012-01-12 20:59:58 +04:00
|
|
|
|
# Add the ‘recurseForDerivations’ attribute to ensure that
|
|
|
|
|
# nix-instantiate recurses into nested attribute sets.
|
|
|
|
|
recurse = attrs:
|
|
|
|
|
if isDerivation attrs
|
|
|
|
|
then attrs
|
|
|
|
|
else { recurseForDerivations = true; } // mapAttrs (n: v: recurse v) attrs;
|
|
|
|
|
|
|
|
|
|
in recurse (call rel)
|