2010-02-05 15:14:43 +01: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 17:59:58 +01:00
|
|
|
|
with import ../../pkgs/lib;
|
2010-02-05 15:14:43 +01:00
|
|
|
|
|
2012-01-12 17:59:58 +01:00
|
|
|
|
let
|
2013-01-14 23:28:18 +01:00
|
|
|
|
trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y);
|
2010-02-05 15:14:43 +01:00
|
|
|
|
|
2010-08-19 14:37:10 +02:00
|
|
|
|
rel = removeAttrs (import ../../pkgs/top-level/release.nix) [ "tarball" "xbursttools" ];
|
2010-02-05 15:14:43 +01:00
|
|
|
|
|
2012-01-12 17:59:58 +01:00
|
|
|
|
seqList = xs: res: fold (x: xs: seq x xs) res xs;
|
2010-08-19 14:37:10 +02:00
|
|
|
|
|
2012-01-12 17:59:58 +01:00
|
|
|
|
strictAttrs = as: seqList (attrValues as) as;
|
2010-08-19 14:37:10 +02:00
|
|
|
|
|
2013-01-14 23:28:18 +01:00
|
|
|
|
maybe = as: let y = builtins.tryEval (strictAttrs as); in if y.success then y.value else builtins.trace "FAIL" {};
|
2010-02-05 15:14:43 +01:00
|
|
|
|
|
2012-01-12 17:59:58 +01:00
|
|
|
|
call = attrs: flip mapAttrs attrs
|
2012-01-24 20:10:54 +01:00
|
|
|
|
(n: v: trace n (
|
2011-10-27 18:50:00 +02:00
|
|
|
|
if builtins.isFunction v then maybe (v { system = "x86_64-linux"; })
|
2010-02-05 15:14:43 +01:00
|
|
|
|
else if builtins.isAttrs v then call v
|
|
|
|
|
else null
|
|
|
|
|
));
|
|
|
|
|
|
2012-01-12 17:59:58 +01: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)
|