nixpkgs: add an update script

this only updates the master branch -- for now
This commit is contained in:
Colin 2024-06-08 20:44:23 +00:00
parent 6e8cb1bbb2
commit 33f4db254d

View File

@ -1,5 +1,6 @@
# XXX: this is in the bootstrap path;
# i'm pretty much restricted to using just `builtin`s here.
# this means it has to be evaluatable using only builtins,
# though i'm free to include optional functionality (e.g. update scripts) so long as i gate it behind availability checks.
#
# branch workflow:
# - daily:
@ -20,7 +21,9 @@
, doPatch ? true
, localSystem ? builtins.currentSystem #< not available in pure mode
, system ? localSystem
#VVV these may or may not be available when called VVV
, fetchzip ? builtins.fetchTarball
, nix-update-script ? null
}:
let
lock = {
@ -31,9 +34,8 @@ let
staging-next.rev = "5aa86ae5585cd46299ee46682fda8a9b76baf2ae";
staging-next.sha256 = "sha256:1dqws7fmdv4l9mk45i88ivzlxzm2b4lbdg9rg4am0z1alsz36dzz";
};
unpatchedSrc = let
lock' = lock."${variant}";
in fetchzip {
lock' = lock."${variant}";
unpatchedSrc = fetchzip {
url = "https://github.com/NixOS/nixpkgs/archive/${lock'.rev}.tar.gz";
inherit (lock') sha256;
};
@ -66,4 +68,15 @@ let
in
# N.B.: this is crafted to allow `nixpkgs.FOO` from other nix code
# AND `nix-build -A nixpkgs`
(import "${src}" args) // src
(import "${src}" args) // src // {
# attributes needed for update scripts
name = "nixpkgs";
version = "24.05-unstable-2024-06-xx";
src = unpatchedSrc // {
inherit (lock') rev;
};
} // (if nix-update-script != null then {
passthru.updateScript = nix-update-script {
extraArgs = [ "--version" "branch" ];
};
} else {})