From 8132f2745ea623b9f4110265cec489959f45d500 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:20:16 +0100 Subject: [PATCH] packages/nixos: place nvidia-ctk-oci-hook in image This places the OCI hook in the expected path in the podvm-image if GPU use is configured. --- packages/nixos/gpu.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nixos/gpu.nix b/packages/nixos/gpu.nix index 021174e341..5560ee759a 100644 --- a/packages/nixos/gpu.nix +++ b/packages/nixos/gpu.nix @@ -1,7 +1,12 @@ # Copyright 2024 Edgeless Systems GmbH # SPDX-License-Identifier: AGPL-3.0-only -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.contrast.gpu; @@ -24,6 +29,10 @@ in }; hardware.nvidia-container-toolkit.enable = true; + image.repart.partitions."10-root".contents."/usr/share/oci/hooks/prestart/nvidia-container-toolkit.sh".source = ( + lib.getExe (pkgs.nvidia-ctk-oci-hook) + ); + boot.initrd.kernelModules = [ # Extra kernel modules required to talk to the GPU in CC-Mode. "ecdsa_generic"