From f5e95f6b3150af736bc9a07d26848f4f83cc5cb4 Mon Sep 17 00:00:00 2001 From: Tom Herbers Date: Tue, 5 May 2026 12:13:28 +0200 Subject: [PATCH] incus: enable use of fetchpatch2 for patches --- pkgs/by-name/in/incus/client.nix | 5 ++++- pkgs/by-name/in/incus/generic.nix | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/in/incus/client.nix b/pkgs/by-name/in/incus/client.nix index 3e03ff4025b8..beaec29e15c8 100644 --- a/pkgs/by-name/in/incus/client.nix +++ b/pkgs/by-name/in/incus/client.nix @@ -9,14 +9,15 @@ lib, buildGoModule, installShellFiles, + fetchpatch2, }: let pname = "incus${lib.optionalString lts "-lts"}-client"; + evaluatedPatches = if lib.isFunction patches then patches fetchpatch2 else patches; in buildGoModule { inherit - patches pname src vendorHash @@ -29,6 +30,8 @@ buildGoModule { subPackages = [ "cmd/incus" ]; + patches = evaluatedPatches; + postInstall = '' # Needed for builds on systems with auto-allocate-uids to pass. # Incus tries to read ~/.config/incus while generating completions diff --git a/pkgs/by-name/in/incus/generic.nix b/pkgs/by-name/in/incus/generic.nix index c3844851bc86..1b518e318e54 100644 --- a/pkgs/by-name/in/incus/generic.nix +++ b/pkgs/by-name/in/incus/generic.nix @@ -14,6 +14,7 @@ stdenv, buildGoModule, fetchFromGitHub, + fetchpatch2, acl, buildPackages, cowsql, @@ -51,6 +52,7 @@ let sphinxext-opengraph ] ); + evaluatedPatches = if lib.isFunction patches then patches fetchpatch2 else patches; in buildGoModule (finalAttrs: { @@ -75,7 +77,7 @@ buildGoModule (finalAttrs: { // (if (rev == null) then { tag = "v${version}"; } else { inherit rev; }) ); - patches = [ ./docs.patch ] ++ patches; + patches = [ ./docs.patch ] ++ evaluatedPatches; excludedPackages = [ # statically compile these