at 18.09-beta 857 B view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 cfg = config.virtualisation.hypervGuest; 7 8in { 9 options = { 10 virtualisation.hypervGuest = { 11 enable = mkEnableOption "Hyper-V Guest Support"; 12 }; 13 }; 14 15 config = mkIf cfg.enable { 16 environment.systemPackages = [ config.boot.kernelPackages.hyperv-daemons.bin ]; 17 18 security.rngd.enable = false; 19 20 # enable hotadding memory 21 services.udev.packages = lib.singleton (pkgs.writeTextFile { 22 name = "hyperv-memory-hotadd-udev-rules"; 23 destination = "/etc/udev/rules.d/99-hyperv-memory-hotadd.rules"; 24 text = '' 25 ACTION="add", SUBSYSTEM=="memory", ATTR{state}="online" 26 ''; 27 }); 28 29 systemd = { 30 packages = [ config.boot.kernelPackages.hyperv-daemons.lib ]; 31 32 targets.hyperv-daemons = { 33 wantedBy = [ "multi-user.target" ]; 34 }; 35 }; 36 }; 37}