Skip to content

Commit

Permalink
nixos on hyperv: load modules and set video mode
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Sep 28, 2018
1 parent 46651b8 commit 3a76bc7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions nixos/modules/virtualisation/hyperv-guest.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,33 @@ in {
options = {
virtualisation.hypervGuest = {
enable = mkEnableOption "Hyper-V Guest Support";

videoMode = mkOption {
type = types.str;
default = "1152x864";
example = "1024x768";
description = ''
Resolution at which to initialize the video adapter.
Supports screen resolution up to Full HD 1920x1080 with 32 bit color
on Windows Server 2012, and 1600x1200 with 16 bit color on Windows
Server 2008 R2 or earlier.
'';
};
};
};

config = mkIf cfg.enable {
boot = {
initrd.kernelModules = [
"hv_balloon" "hv_netvsc" "hv_storvsc" "hv_utils" "hv_vmbus"
];

kernelParams = [
"video=hyperv_fb:${cfg.videoMode}"
];
};

environment.systemPackages = [ config.boot.kernelPackages.hyperv-daemons.bin ];

security.rngd.enable = false;
Expand Down

0 comments on commit 3a76bc7

Please sign in to comment.