Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ddc8398e7f16
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 13b815603077
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jul 8, 2019

  1. Copy the full SHA
    13b8156 View commit details
Showing with 11 additions and 1 deletion.
  1. +11 −1 nixos/modules/virtualisation/kvmgt.nix
12 changes: 11 additions & 1 deletion nixos/modules/virtualisation/kvmgt.nix
Original file line number Diff line number Diff line change
@@ -4,13 +4,16 @@ with lib;

let
cfg = config.virtualisation.kvmgt;

kernelPackages = config.boot.kernelPackages;

vgpuOptions = {
uuid = mkOption {
type = types.string;
description = "UUID of VGPU device. You can generate one with <package>libossp_uuid</package>.";
};
};

in {
options = {
virtualisation.kvmgt = {
@@ -45,7 +48,13 @@ in {
assertion = versionAtLeast kernelPackages.kernel.version "4.16";
message = "KVMGT is not properly supported for kernels older than 4.16";
};
boot.kernelParams = [ "i915.enable_gvt=1" ];

boot.kernelModules = [ "kvmgt" ];

boot.extraModprobeConfig = ''
options i915 enable_gvt=1
'';

systemd.paths = mapAttrs' (name: value:
nameValuePair "kvmgt-${name}" {
description = "KVMGT VGPU ${name} path";
@@ -55,6 +64,7 @@ in {
};
}
) cfg.vgpus;

systemd.services = mapAttrs' (name: value:
nameValuePair "kvmgt-${name}" {
description = "KVMGT VGPU ${name}";