From 1af136f785fb5e5da7a772cc8a3e4fd744994f6b Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Sat, 3 Jan 2026 21:27:21 -0500 Subject: [PATCH] incus: patch lxc/rootfs directory to fix tmpfs-overlay --- pkgs/by-name/in/incus/generic.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/in/incus/generic.nix b/pkgs/by-name/in/incus/generic.nix index 364d4a7017a1..b47d29f3d04e 100644 --- a/pkgs/by-name/in/incus/generic.nix +++ b/pkgs/by-name/in/incus/generic.nix @@ -108,6 +108,17 @@ buildGoModule (finalAttrs: { # required for go-cowsql. CGO_LDFLAGS_ALLOW = "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"; + # add our lxc location to incus's acceptable rootFsPaths + # this is necessary for tmpfs/tmpfs-overlay to work + postPatch = + if (lib.versionAtLeast finalAttrs.version "6.16") then + '' + substituteInPlace internal/server/device/disk.go \ + --replace-fail '"/opt/incus/lib/lxc/rootfs/"' '"${lxc}/lib/lxc/rootfs/"' + '' + else + null; + postBuild = '' # build docs mkdir -p .sphinx/deps