at 18.09-beta 842 B view raw
1# Evaluate `release.nix' like Hydra would. Too bad nix-instantiate 2# can't to do this. 3 4with import ../../lib; 5 6let 7 trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y); 8 9 rel = removeAttrs (import ../../pkgs/top-level/release.nix { }) [ "tarball" "unstable" "xbursttools" ]; 10 11 # Add the ‘recurseForDerivations’ attribute to ensure that 12 # nix-instantiate recurses into nested attribute sets. 13 recurse = path: attrs: 14 if (builtins.tryEval attrs).success then 15 if isDerivation attrs 16 then 17 if (builtins.tryEval attrs.drvPath).success 18 then { inherit (attrs) name drvPath; } 19 else { failed = true; } 20 else { recurseForDerivations = true; } // 21 mapAttrs (n: v: let path' = path ++ [n]; in trace path' (recurse path' v)) attrs 22 else { }; 23 24in recurse [] rel