From f139c76d7aea21addff625f3d94dcc9869482a7c Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Tue, 14 Nov 2023 21:44:33 -0800 Subject: [PATCH] Let containers be compatible with libnvidia-container Currently containers created by `devenv` will contain a symlink `/lib -> /nix/store/lf0wpjrj8yx4gsmw2s3xfl58ixmqk8qa-bash-5.2-p15/lib`. The symlink conflicts with `libnvidia-container` because `libnvidia-container` tries to create a file `/lib/firmware/nvidia/525.85.12/gsp_ad10x.bin` while it specifies `O_NOFOLLOW` according to https://github.com/NVIDIA/libnvidia-container/blob/1eb5a30a6ad0415550a9df632ac8832bf7e2bbba/src/utils.c#L523 This PR makes `/lib` a regular directory, while making files under `/lib` symlinks so that it would be compatible with `libnvidia-container`. --- src/modules/containers.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/containers.nix b/src/modules/containers.nix index 63a026a50..15a120c26 100644 --- a/src/modules/containers.nix +++ b/src/modules/containers.nix @@ -49,7 +49,7 @@ let (if builtins.typeOf cfg.copyToRoot == "list" then cfg.copyToRoot else [ cfg.copyToRoot ]); - pathsToLink = "/"; + pathsToLink = [ "/" "/lib" ]; }) ]; config = {