diff --git a/packages/by-name/mkNixosConfig/package.nix b/packages/by-name/mkNixosConfig/package.nix index c4187f7b9a..3b08d93d54 100644 --- a/packages/by-name/mkNixosConfig/package.nix +++ b/packages/by-name/mkNixosConfig/package.nix @@ -41,6 +41,7 @@ lib.makeOverridable ( cloud-api-adaptor kernel-podvm-azure pause-bundle + nvidia-ctk-oci-hook nvidia-ctk-with-config ; inherit (outerPkgs.kata) kata-agent; diff --git a/packages/by-name/nvidia-ctk-oci-hook/package.nix b/packages/by-name/nvidia-ctk-oci-hook/package.nix new file mode 100644 index 0000000000..dfd5d0457d --- /dev/null +++ b/packages/by-name/nvidia-ctk-oci-hook/package.nix @@ -0,0 +1,27 @@ +# Copyright 2024 Edgeless Systems GmbH +# SPDX-License-Identifier: AGPL-3.0-only + +{ + writeShellApplication, + nvidia-ctk-with-config, + lib, +}: +writeShellApplication { + name = "nvidia-ctk-oci-hook"; + + text = '' + # Log the o/p of the hook to a file + ${lib.getExe' nvidia-ctk-with-config "nvidia-container-runtime-hook"} \ + -config ${nvidia-ctk-with-config}/etc/nvidia-container-runtime/config.toml \ + -debug "$@" > /var/log/nvidia-hook.log 2>&1 + ''; + + meta = { + description = "OCI hook for nvidia-container-runtime"; + longDescription = '' + This is an OCI hook (prestart) for the nvidia-container-runtime. It is used to + facilitate GPU containers in peer pods with the necessary drivers, libraries, + and binaries to access the GPU. + ''; + }; +}