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:
+15
@@ -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"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user