fix impure.nix
to be compatible with updateScripts
This commit is contained in:
@@ -8,8 +8,9 @@
|
|||||||
localSystem ? builtins.currentSystem,
|
localSystem ? builtins.currentSystem,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
mkNixpkgs = import ./pkgs/by-name/nixpkgs-bootstrap/mkNixpkgs.nix {};
|
||||||
mkPkgs = branch: args: (
|
mkPkgs = branch: args: (
|
||||||
import ./pkgs/by-name/nixpkgs-bootstrap/${branch}.nix args
|
mkNixpkgs (args // { inherit branch; })
|
||||||
).extend (import ./overlays/all.nix);
|
).extend (import ./overlays/all.nix);
|
||||||
pkgs = mkPkgs "master" { inherit localSystem; };
|
pkgs = mkPkgs "master" { inherit localSystem; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
@@ -6,11 +6,10 @@
|
|||||||
# - paste the output as the new `sha256`
|
# - paste the output as the new `sha256`
|
||||||
{
|
{
|
||||||
mkNixpkgs ? import ./mkNixpkgs.nix {},
|
mkNixpkgs ? import ./mkNixpkgs.nix {},
|
||||||
...
|
}:
|
||||||
}@args:
|
mkNixpkgs {
|
||||||
mkNixpkgs ({
|
|
||||||
rev = "5db39d669a21ca7f0e76c295e7664b9d938b7042";
|
rev = "5db39d669a21ca7f0e76c295e7664b9d938b7042";
|
||||||
sha256 = "sha256-SUZZMAn19X3Ym6lVb18LoXhCS2yicrRr83si5VyJDS0=";
|
sha256 = "sha256-SUZZMAn19X3Ym6lVb18LoXhCS2yicrRr83si5VyJDS0=";
|
||||||
version = "0-unstable-2025-02-28";
|
version = "0-unstable-2025-02-28";
|
||||||
branch = "master";
|
branch = "master";
|
||||||
} // args)
|
}
|
||||||
|
@@ -28,10 +28,10 @@ let
|
|||||||
fetchzip' = if inBootstrap then builtins.fetchTarball else fetchzip;
|
fetchzip' = if inBootstrap then builtins.fetchTarball else fetchzip;
|
||||||
optionalAttrs = cond: attrs: if cond then attrs else {};
|
optionalAttrs = cond: attrs: if cond then attrs else {};
|
||||||
mkNixpkgs = {
|
mkNixpkgs = {
|
||||||
rev,
|
|
||||||
sha256,
|
|
||||||
branch,
|
branch,
|
||||||
version,
|
rev ? null,
|
||||||
|
sha256 ? null,
|
||||||
|
version ? null,
|
||||||
#VVV config
|
#VVV config
|
||||||
localSystem ? if stdenv != null then stdenv.buildPlatform.system else builtins.currentSystem, #< not available in pure mode
|
localSystem ? if stdenv != null then stdenv.buildPlatform.system else builtins.currentSystem, #< not available in pure mode
|
||||||
system ? if stdenv != null then stdenv.hostPlatform.system else localSystem,
|
system ? if stdenv != null then stdenv.hostPlatform.system else localSystem,
|
||||||
@@ -84,41 +84,48 @@ let
|
|||||||
} else {});
|
} else {});
|
||||||
nixpkgs = import "${patchedSrc}" nixpkgsArgs;
|
nixpkgs = import "${patchedSrc}" nixpkgsArgs;
|
||||||
in
|
in
|
||||||
# N.B.: this is crafted to allow `nixpkgs.FOO` from other nix code
|
if rev == null && sha256 == null && version == null then
|
||||||
# AND `nix-build -A nixpkgs`
|
import ./${branch}.nix {
|
||||||
patchedSrc.overrideAttrs (base: {
|
mkNixpkgs = args': mkNixpkgs ({
|
||||||
# attributes needed for update scripts
|
inherit localSystem system;
|
||||||
inherit version;
|
} // args');
|
||||||
pname = "nixpkgs";
|
}
|
||||||
passthru = (base.passthru or {}) // nixpkgs // {
|
else
|
||||||
# override is used to configure hostPlatform higher up.
|
# N.B.: this is crafted to allow `nixpkgs.FOO` from other nix code
|
||||||
override = overrideArgs: mkNixpkgs (args // overrideArgs);
|
# AND `nix-build -A nixpkgs`
|
||||||
|
patchedSrc.overrideAttrs (base: {
|
||||||
|
# attributes needed for update scripts
|
||||||
|
inherit version;
|
||||||
|
pname = "nixpkgs";
|
||||||
|
passthru = (base.passthru or {}) // nixpkgs // {
|
||||||
|
# override is used to configure hostPlatform higher up.
|
||||||
|
override = overrideArgs: mkNixpkgs (args // overrideArgs);
|
||||||
|
|
||||||
# N.B.: src has to be specified in passthru, not the outer scope, so as to take precedence over the nixpkgs `src` package
|
# N.B.: src has to be specified in passthru, not the outer scope, so as to take precedence over the nixpkgs `src` package
|
||||||
src = {
|
src = {
|
||||||
# required by unstableGitUpdater
|
# required by unstableGitUpdater
|
||||||
gitRepoUrl = "https://github.com/NixOS/nixpkgs.git";
|
gitRepoUrl = "https://github.com/NixOS/nixpkgs.git";
|
||||||
inherit rev;
|
inherit rev;
|
||||||
} // src';
|
} // src';
|
||||||
|
|
||||||
# required so that unstableGitUpdater can know in which file the `rev` variable can be updated in.
|
# required so that unstableGitUpdater can know in which file the `rev` variable can be updated in.
|
||||||
meta.position = let
|
meta.position = let
|
||||||
position = builtins.unsafeGetAttrPos "rev" args;
|
position = builtins.unsafeGetAttrPos "rev" args;
|
||||||
in
|
in
|
||||||
"${position.file}:${toString position.line}";
|
"${position.file}:${toString position.line}";
|
||||||
|
|
||||||
# while we could *technically* use `nixpkgs.<...>` updateScript
|
# while we could *technically* use `nixpkgs.<...>` updateScript
|
||||||
# that can force maaany rebuilds on staging/staging-next.
|
# that can force maaany rebuilds on staging/staging-next.
|
||||||
# updateScript = nix-update-script {
|
# updateScript = nix-update-script {
|
||||||
# extraArgs = [ "--version=branch=${branch}" ];
|
# extraArgs = [ "--version=branch=${branch}" ];
|
||||||
# };
|
# };
|
||||||
updateScript = unstableGitUpdater {
|
updateScript = unstableGitUpdater {
|
||||||
# else the update script tries to walk 10000's of commits to find a tag
|
# else the update script tries to walk 10000's of commits to find a tag
|
||||||
hardcodeZeroVersion = true;
|
hardcodeZeroVersion = true;
|
||||||
inherit branch;
|
inherit branch;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
})
|
||||||
})
|
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
mkNixpkgs
|
mkNixpkgs
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
mkNixpkgs ? import ./mkNixpkgs.nix {},
|
mkNixpkgs ? import ./mkNixpkgs.nix {},
|
||||||
...
|
}:
|
||||||
}@args:
|
mkNixpkgs {
|
||||||
mkNixpkgs ({
|
|
||||||
rev = "749375426d72ead4bdac625818e7be62a6bbbaf4";
|
rev = "749375426d72ead4bdac625818e7be62a6bbbaf4";
|
||||||
sha256 = "sha256-IDxPfbSdIy7XAP1hneGOfr2jsj+hFUsvFhpRksYqols=";
|
sha256 = "sha256-IDxPfbSdIy7XAP1hneGOfr2jsj+hFUsvFhpRksYqols=";
|
||||||
version = "0-unstable-2025-02-28";
|
version = "0-unstable-2025-02-28";
|
||||||
branch = "staging-next";
|
branch = "staging-next";
|
||||||
} // args)
|
}
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
mkNixpkgs ? import ./mkNixpkgs.nix {},
|
mkNixpkgs ? import ./mkNixpkgs.nix {},
|
||||||
...
|
}:
|
||||||
}@args:
|
mkNixpkgs {
|
||||||
mkNixpkgs ({
|
|
||||||
rev = "29dcbf482396b9e5bdf1ec92973a8451e0aaa1d5";
|
rev = "29dcbf482396b9e5bdf1ec92973a8451e0aaa1d5";
|
||||||
sha256 = "sha256-ps1xz98RAUqrT+V7GFpzf/uHaoh9o5ZoOpE7SnSB6sY=";
|
sha256 = "sha256-ps1xz98RAUqrT+V7GFpzf/uHaoh9o5ZoOpE7SnSB6sY=";
|
||||||
version = "0-unstable-2025-02-28";
|
version = "0-unstable-2025-02-28";
|
||||||
branch = "staging";
|
branch = "staging";
|
||||||
} // args)
|
}
|
||||||
|
Reference in New Issue
Block a user