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