2024-03-06 12:21:00 -08:00
|
|
|
|
# Evaluate `release.nix' like Hydra would. Too bad nix-instantiate can't to do this.
|
2010-02-05 14:14:43 +00:00
|
|
|
|
|
2012-01-12 16:59:58 +00:00
|
|
|
|
let
|
2024-03-06 12:21:00 -08:00
|
|
|
|
inherit (import ../../lib) isDerivation mapAttrs;
|
|
|
|
|
|
2013-01-14 23:28:18 +01:00
|
|
|
|
trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y);
|
2010-02-05 14:14:43 +00:00
|
|
|
|
|
2024-04-22 22:43:29 +03:00
|
|
|
|
rel = removeAttrs (import ../../pkgs/top-level/release.nix { }) [
|
|
|
|
|
"tarball"
|
|
|
|
|
"unstable"
|
|
|
|
|
];
|
2010-02-05 14:14:43 +00:00
|
|
|
|
|
2012-01-12 16:59:58 +00:00
|
|
|
|
# Add the ‘recurseForDerivations’ attribute to ensure that
|
|
|
|
|
# nix-instantiate recurses into nested attribute sets.
|
2013-10-06 00:03:14 +02:00
|
|
|
|
recurse =
|
|
|
|
|
path: attrs:
|
2013-03-26 11:53:36 +01:00
|
|
|
|
if (builtins.tryEval attrs).success then
|
2013-10-06 00:03:14 +02:00
|
|
|
|
if isDerivation attrs then
|
|
|
|
|
if (builtins.tryEval attrs.drvPath).success then
|
|
|
|
|
{ inherit (attrs) name drvPath; }
|
|
|
|
|
else
|
|
|
|
|
{ failed = true; }
|
2023-01-31 15:10:12 +01:00
|
|
|
|
else if attrs == null then
|
2013-10-06 00:03:14 +02:00
|
|
|
|
{ }
|
|
|
|
|
else
|
2024-12-10 20:26:33 +01:00
|
|
|
|
{
|
2013-10-06 00:03:14 +02:00
|
|
|
|
recurseForDerivations = true;
|
2024-12-10 20:26:33 +01:00
|
|
|
|
}
|
2013-10-06 00:03:14 +02:00
|
|
|
|
// mapAttrs (
|
|
|
|
|
n: v:
|
|
|
|
|
let
|
|
|
|
|
path' = path ++ [ n ];
|
|
|
|
|
in
|
|
|
|
|
trace path' (recurse path' v)
|
|
|
|
|
) attrs
|
2013-03-26 11:53:36 +01:00
|
|
|
|
else
|
|
|
|
|
{ };
|
|
|
|
|
|
2013-10-06 00:03:14 +02:00
|
|
|
|
in
|
|
|
|
|
recurse [ ] rel
|