lol
at 24.11-pre 24 lines 890 B 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 { }) [ "tarball" "unstable" ]; 9 10 # Add the ‘recurseForDerivations’ attribute to ensure that 11 # nix-instantiate recurses into nested attribute sets. 12 recurse = path: attrs: 13 if (builtins.tryEval attrs).success then 14 if isDerivation attrs 15 then 16 if (builtins.tryEval attrs.drvPath).success 17 then { inherit (attrs) name drvPath; } 18 else { failed = true; } 19 else if attrs == null then {} 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