From 527ecba696e2648a62fce9528a543333ef13e779 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 11 Jul 2026 17:08:40 +0200 Subject: [PATCH] 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 --- release.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/release.nix b/release.nix index 29022a7e7..edfdd43b7 100644 --- a/release.nix +++ b/release.nix @@ -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"));