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