fix(nixery): Avoid impure reading of .git directory

Change-Id: I67405f9c9bd9cc8cb34fafff80e30b2fca53a2b3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5502
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2022-04-21 16:28:54 +02:00 committed by clbot
parent c05c4995ab
commit 119462d720

View file

@ -21,11 +21,9 @@ with pkgs;
let
inherit (pkgs) buildGoModule;
# Current Nixery commit - this is used as the Nixery version in
# builds to distinguish errors between deployed versions, see
# server/logs.go for details.
gitDir = if builtins.pathExists ./.git then ./.git else ../../.git;
nixery-commit-hash = args.commitHash or pkgs.lib.commitIdFromGitRepo gitDir;
# Avoid extracting this from git until we have a way to plumb
# through revision numbers.
nixery-commit-hash = "depot";
# Go implementation of the Nixery server which implements the
# container registry interface.