From 82a67478fb2ecf07954da0e245338bebae7c24d1 Mon Sep 17 00:00:00 2001 From: Dich0tomy <75364377+Dich0tomy@users.noreply.github.com> Date: Wed, 5 Aug 2026 01:54:48 +0200 Subject: [PATCH] fix(build): use a newer version of libgit2 The `libgit2-sys-1.9.6` crate in the repo requires that the version of `libgit2` in the system is >= `1.9.6` - the latest version in unstable is `1.9.4`. There are several ways to go about it - two most reasonable ones being bumping down `libgit2-sys` or simply using an overriden `pkgs.libgit`, which is what we do. --- flake.nix | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index e472ed7..838afc0 100644 --- a/flake.nix +++ b/flake.nix @@ -42,11 +42,34 @@ pkgs.pkg-config ]; - buildInputs = [ - pkgs.libgit2 - pkgs.openssl - pkgs.zlib - ]; + buildInputs = + let + libgit2-196 = + let + overrideObsolete = pkgs.lib.versionAtLeast pkgs.libgit2.version "1.9.6"; + in + ( + if overrideObsolete then + pkgs.lib.warn "The libgit2 override is no longer needed, `pkgs.libgit2.version`>=`${pkgs.libgit2.version}`." pkgs.libgit2 + else + (pkgs.libgit2.overrideAttrs ( + f: p: { + version = "1.9.6"; + src = pkgs.fetchFromGitHub { + owner = "libgit2"; + repo = "libgit2"; + tag = "v${f.version}"; + hash = "sha256-ogowkZrw9MG4pcgXHzzNX5fm1Z8L2tNW8MDfL4ySJyY="; + }; + } + )) + ); + in + [ + libgit2-196 + pkgs.openssl + pkgs.zlib + ]; env = { LIBGIT2_NO_VENDOR = true;