release.nix: mock rev/lastModified attrs when nixpkgs is a path

Some code-paths expect e.g. `nixpkgs.rev` to exist.
This change makes sure this always exists. This is done on purpose
within this let-in dance rather than in the default such that
`nix-build release.nix --arg nixpkgs ../nixpkgs` also benefits from this
fix.

Change-Id: I94f1f901823d3df433e3c44ae380bb2f67eef70e
This commit is contained in:
Maximilian Bosch
2026-07-11 21:18:59 +02:00
parent 72f8000b8f
commit 527ecba696
+15
View File
@@ -4,6 +4,21 @@
lixSrc ? builtins.fetchGit ./.,
}:
let
nixpkgs' =
if builtins.isAttrs nixpkgs then
nixpkgs
else
{
outPath = nixpkgs;
rev = "0000000000000000000000000000000000000000";
shortRev = "0000000";
lastModifiedDate = "19700101000000";
};
in
let
nixpkgs = nixpkgs';
in
let
flakeLock = builtins.fromJSON (builtins.readFile (lixSrc + "/flake.lock"));