Skip to content

Commit 2771f21

Browse files
committed
overlays: fix libnvidia-container library symlinks
This pulls in an upstream PR that fixes the output paths of libnvidia-container to not include dangling symlinks, which otherwise confuses nvidia-container-toolkit.
1 parent a3965d2 commit 2771f21

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

overlays/nixpkgs.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,19 @@ final: prev:
3131
--set SOURCE_DATE_EPOCH 0
3232
'';
3333
});
34+
35+
# Fixes a dangling symlink in the libnvidia-container package that confuses
36+
# the nvidia-container-toolkit.
37+
# TODO(msanft): Remove once https://github.com/NixOS/nixpkgs/pull/375291 is merged and
38+
# pulled into Contrast.
39+
libnvidia-container = prev.libnvidia-container.overrideAttrs (prev: {
40+
postFixup = ''
41+
# Recreate library symlinks which ldconfig would have created
42+
for lib in libnvidia-container libnvidia-container-go; do
43+
rm -f "$out/lib/$lib.so"
44+
ln -s "$out/lib/$lib.so.${prev.version}" "$out/lib/$lib.so.1"
45+
ln -s "$out/lib/$lib.so.1" "$out/lib/$lib.so"
46+
done
47+
'';
48+
});
3449
}

0 commit comments

Comments
 (0)