Commit 0420b1de authored by Rafael Fernández López's avatar Rafael Fernández López
Browse files

nvidia-container-toolkit: add disable-hooks and enable-hooks options

parent f4010df3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
  device-name-strategy,
  discovery-mode,
  mounts,
  disable-hooks,
  enable-hooks,
  glibc,
  jq,
  lib,
@@ -37,7 +39,8 @@ writeScriptBin "nvidia-cdi-generator" ''
      }
      --discovery-mode ${discovery-mode} \
      --device-name-strategy ${device-name-strategy} \
      --disable-hook create-symlinks \
      ${lib.concatMapStringsSep " \\\n" (hook: "--disable-hook ${hook}") disable-hooks} \
      ${lib.concatMapStringsSep " \\\n" (hook: "--enable-hook ${hook}") enable-hooks} \
      --ldconfig-path ${lib.getExe' glibc "ldconfig"} \
      --library-search-path ${lib.getLib nvidia-driver}/lib \
      --nvidia-cdi-hook-path ${lib.getOutput "tools" nvidia-container-toolkit}/bin/nvidia-cdi-hook \
+22 −0
Original line number Diff line number Diff line
@@ -120,6 +120,26 @@

        package = lib.mkPackageOption pkgs "nvidia-container-toolkit" { };

        disable-hooks = lib.mkOption {
          type = lib.types.listOf lib.types.nonEmptyStr;
          default = [ "create-symlinks" ];
          description = ''
            List of hooks to disable when generating the CDI specification.
            Each hook name will be passed as `--disable-hook <hook-name>` to nvidia-ctk.
            Set to an empty list to disable no hooks.
          '';
        };

        enable-hooks = lib.mkOption {
          type = lib.types.listOf lib.types.nonEmptyStr;
          default = [ ];
          description = ''
            List of hooks to enable when generating the CDI specification.
            Each hook name will be passed as `--enable-hook <hook-name>` to nvidia-ctk.
            Set to an empty list to enable no hooks.
          '';
        };

        extraArgs = lib.mkOption {
          type = lib.types.listOf lib.types.str;
          default = [ ];
@@ -306,6 +326,8 @@
                  device-name-strategy
                  discovery-mode
                  mounts
                  disable-hooks
                  enable-hooks
                  extraArgs
                  ;
                nvidia-container-toolkit = config.hardware.nvidia-container-toolkit.package;