nixpkgs-bootstrap.mkNixpkgs: remove the overrideAttrs
call, and inline its functionality into applyPatches
This commit is contained in:
@@ -101,9 +101,15 @@ let
|
||||
fetchpatch2' = if fetchpatch2 != null then fetchpatch2 else unpatchedNixpkgs.fetchpatch2;
|
||||
|
||||
patchedSrc = applyPatches' {
|
||||
src = src';
|
||||
name = "nixpkgs-patched-uninsane";
|
||||
inherit version;
|
||||
|
||||
src = {
|
||||
# required by unstableGitUpdater
|
||||
gitRepoUrl = "https://github.com/NixOS/nixpkgs.git";
|
||||
inherit rev;
|
||||
} // src';
|
||||
|
||||
patches = import ./patches.nix { fetchpatch2 = fetchpatch2'; };
|
||||
# skip applied patches
|
||||
prePatch = ''
|
||||
@@ -112,34 +118,10 @@ let
|
||||
OUT=$($realpatch "$@") || echo "$OUT" | grep "Skipping patch" -q
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgsArgs = commonNixpkgsArgs // {
|
||||
config = {
|
||||
allowUnfree = true; # NIXPKGS_ALLOW_UNFREE=1
|
||||
allowBroken = true; # NIXPKGS_ALLOW_BROKEN=1
|
||||
};
|
||||
} // (if (system != localSystem) then {
|
||||
# XXX(2023/12/11): cache.nixos.org uses `system = ...` instead of `hostPlatform.system`, and that choice impacts the closure of every package.
|
||||
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
|
||||
crossSystem = system;
|
||||
} else {});
|
||||
nixpkgs = import patchedSrc nixpkgsArgs;
|
||||
in
|
||||
patchedSrc.overrideAttrs (base: {
|
||||
# attributes needed for update scripts.
|
||||
# TODO: should be possible to pass these straight through `applyPatches` instead of using `overrideAttrs`.
|
||||
inherit version;
|
||||
pname = "nixpkgs";
|
||||
passthru = (base.passthru or {}) // {
|
||||
passthru = {
|
||||
pkgs = nixpkgs;
|
||||
|
||||
src = {
|
||||
# required by unstableGitUpdater
|
||||
gitRepoUrl = "https://github.com/NixOS/nixpkgs.git";
|
||||
inherit rev;
|
||||
} // src';
|
||||
|
||||
# required so that unstableGitUpdater can know in which file the `rev` variable can be updated in.
|
||||
meta.position = let
|
||||
position = builtins.unsafeGetAttrPos "rev" args;
|
||||
@@ -157,7 +139,21 @@ let
|
||||
inherit branch;
|
||||
};
|
||||
};
|
||||
})
|
||||
};
|
||||
|
||||
nixpkgsArgs = commonNixpkgsArgs // {
|
||||
config = {
|
||||
allowUnfree = true; # NIXPKGS_ALLOW_UNFREE=1
|
||||
allowBroken = true; # NIXPKGS_ALLOW_BROKEN=1
|
||||
};
|
||||
} // (if (system != localSystem) then {
|
||||
# XXX(2023/12/11): cache.nixos.org uses `system = ...` instead of `hostPlatform.system`, and that choice impacts the closure of every package.
|
||||
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
|
||||
crossSystem = system;
|
||||
} else {});
|
||||
nixpkgs = import patchedSrc nixpkgsArgs;
|
||||
in
|
||||
patchedSrc
|
||||
;
|
||||
in
|
||||
mkNixpkgs
|
||||
|
Reference in New Issue
Block a user