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