about summary refs log tree commit diff
path: root/tools/nixery
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2021-08-06T11·21+0300
committerVincent Ambo <mail@tazj.in>2021-08-06T11·27+0300
commit02455bd0fdf42c698524320c8d43b2bd7ef11c3b (patch)
treea2b1d22d9700227f566599ec628281c28c2015a9 /tools/nixery
parent84fb380f574aa4dac4e4cc4c9d0cded8a4c54fa3 (diff)
chore(build): Allow passing in a specific commit hash when building
Required for builds where the full repository isn't available (e.g.
from a tarball).
Diffstat (limited to 'tools/nixery')
-rw-r--r--tools/nixery/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/nixery/default.nix b/tools/nixery/default.nix
index 39003537516c..696420d0f048 100644
--- a/tools/nixery/default.nix
+++ b/tools/nixery/default.nix
@@ -15,7 +15,8 @@
 { pkgs ? import ./nixpkgs-pin.nix
 , preLaunch ? ""
 , extraPackages ? []
-, maxLayers ? 20 }:
+, maxLayers ? 20
+, commitHash ? null }@args:
 
 with pkgs;
 
@@ -25,7 +26,7 @@ let
   # Current Nixery commit - this is used as the Nixery version in
   # builds to distinguish errors between deployed versions, see
   # server/logs.go for details.
-  nixery-commit-hash = pkgs.lib.commitIdFromGitRepo ./.git;
+  nixery-commit-hash = args.commitHash or pkgs.lib.commitIdFromGitRepo ./.git;
 
   # Go implementation of the Nixery server which implements the
   # container registry interface.