From 12628c42a2b33907db26f5251abbc431b55ea95e 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/nixos/gpu.nix b/packages/nixos/gpu.nix index 021174e341..790afcf7e4 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,8 @@ 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"