From ec0965e2672899d25a5a3a8c072de3ea734076a2 Mon Sep 17 00:00:00 2001 From: V Date: Wed, 9 Jun 2021 15:43:16 +0200 Subject: fleet: init Co-authored-by: edef Change-Id: I36d2c4cca542ed91630b1b832f3c7a7b97b33c65 --- fleet/hosts/trieste/build-from-git.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fleet/hosts/trieste/build-from-git.nix (limited to 'fleet/hosts/trieste/build-from-git.nix') diff --git a/fleet/hosts/trieste/build-from-git.nix b/fleet/hosts/trieste/build-from-git.nix new file mode 100644 index 0000000..f04ef48 --- /dev/null +++ b/fleet/hosts/trieste/build-from-git.nix @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: V +# SPDX-License-Identifier: OSL-3.0 + +{ repo, pkgs ? import {} }: + +pkgs.callPackage (builtins.fetchGit { + url = repo; + # While Nix will happily just fetch from HEAD if you only pass in a + # path, it will also cache the result for an hour, making it totally + # unsuitable for what we're doing. lib.commitIdFromGitRepo, on the + # other hand, is implemented purely in Nix and does not cache lookups + # from one invocation to the next. This lets us "impurely" fetch from + # HEAD while enjoying the niceties of using builtins.fetchGit with a + # specific commit hash. + rev = pkgs.lib.commitIdFromGitRepo repo; +}).outPath {} -- cgit 1.4.1