let sources = import ./Sources.nix { sourcesFile = ./Sources.json; }; in import sources.nixpkgs { system = __currentSystem; overlays = [ (_: _: { inherit sources; }) (_: pkgs: { overridePinnedDeps = builder: pkgs.lib.genAttrs (builtins.attrNames pkgs.sources) builder; }) (_: pkgs: { # Modifies a derivation with our source and version, keeping old build # rules. This will fail if build steps have changed, or if no build # rules are available upstream. overrideSource = depName: pkgs.${depName}.overrideAttrs (old: old // rec { version = pkgs.sources.${depName}.version or pkgs.sources.${depName}.rev; src = pkgs.sources.${depName}; }); }) (_: pkgs: # override pinned deps with our sources pkgs.overridePinnedDeps pkgs.overrideSource) (import ./Deps.nix) (_: pkgs: { niv = import pkgs.sources.niv {}; }) ]; config = { allowBroken = true; allowUnfree = true; }; }