From 30efa0ad83c00b200acc8959499f71ded897191c Mon Sep 17 00:00:00 2001 From: emilylange Date: Thu, 13 Nov 2025 21:18:22 +0100 Subject: [PATCH 1/2] mirror-nixos-branch: also expose date of commit This is both very useful when viewing the summary html page on releases.nixos.org (via channels.nixos.org) and also makes it so when using the nixexprs.tar.xz as flake input, the flake metadata shows the same date as the equivalent github:NixOS/nixpkgs would yield, instead of relying on whatever the newest lastMod of any file in the tarball is. --- mirror-nixos-branch.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl index 6dd60a2..abe3d01 100755 --- a/mirror-nixos-branch.pl +++ b/mirror-nixos-branch.pl @@ -107,8 +107,12 @@ sub fetch { my $rev = $evalInfo->{jobsetevalinputs}->{nixpkgs}->{revision} or die; +# Get commit date of $rev as unixtime and formatted string +my $revUnix = `git show --no-patch --format='%ct' $rev` or die; +my $revDate = strftime("%F %T", localtime($revUnix)); + print STDERR "\nRelease information:\n"; -print STDERR " - release is: $releaseName (build $releaseId)\n - eval is: $evalId\n - prefix is: $releasePrefix\n - Git commit is: $rev\n\n"; +print STDERR " - release is: $releaseName (build $releaseId)\n - eval is: $evalId\n - prefix is: $releasePrefix\n - Git commit is: $rev\n - Git commit date is: $revDate\n\n"; if ($bucketChannels) { # Guard against the channel going back in time. @@ -280,7 +284,7 @@ sub fetch { my $html = ""; $html .= "$title"; $html .= "

$title

"; - $html .= "

Released on $now from Git commit $rev "; + $html .= "

Released on $now from Git commit $rev from $revDate "; $html .= "via Hydra evaluation $evalId.

"; $html .= ""; @@ -357,7 +361,7 @@ sub redirect { # Update channels on channels.nixos.org. redirect($channelName, $releasePrefix); -redirect("$channelName/nixexprs.tar.xz", "$releasePrefix/nixexprs.tar.xz?rev=$rev"); +redirect("$channelName/nixexprs.tar.xz", "$releasePrefix/nixexprs.tar.xz?rev=$rev&lastModified=$revUnix"); redirect("$channelName/git-revision", "$releasePrefix/git-revision"); redirect("$channelName/packages.json.br", "$releasePrefix/packages.json.br"); redirect("$channelName/store-paths.xz", "$releasePrefix/store-paths.xz"); From ab78371554322b5f6604240652ea81c5f0803170 Mon Sep 17 00:00:00 2001 From: emilylange Date: Thu, 13 Nov 2025 21:31:12 +0100 Subject: [PATCH 2/2] mirror-nixos-branch: show timezone to avoid confusion --- mirror-nixos-branch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl index abe3d01..bac4cb7 100755 --- a/mirror-nixos-branch.pl +++ b/mirror-nixos-branch.pl @@ -109,7 +109,7 @@ sub fetch { # Get commit date of $rev as unixtime and formatted string my $revUnix = `git show --no-patch --format='%ct' $rev` or die; -my $revDate = strftime("%F %T", localtime($revUnix)); +my $revDate = strftime("%F %T %Z", localtime($revUnix)); print STDERR "\nRelease information:\n"; print STDERR " - release is: $releaseName (build $releaseId)\n - eval is: $evalId\n - prefix is: $releasePrefix\n - Git commit is: $rev\n - Git commit date is: $revDate\n\n"; @@ -277,7 +277,7 @@ sub fetch { run("xz", "$tmpDir/store-paths"); } - my $now = strftime("%F %T", localtime); + my $now = strftime("%F %T %Z", localtime); my $title = "$channelName release $releaseName"; my $githubLink = "https://github.com/NixOS/nixpkgs/commits/$rev";
File nameSizeSHA-256 hash