lol

hyperv-daemons: add nixos module

+38
+1
nixos/modules/module-list.nix
··· 746 746 ./virtualisation/lxcfs.nix 747 747 ./virtualisation/lxd.nix 748 748 ./virtualisation/amazon-options.nix 749 + ./virtualisation/hyperv-guest.nix 749 750 ./virtualisation/openvswitch.nix 750 751 ./virtualisation/parallels-guest.nix 751 752 ./virtualisation/rkt.nix
+37
nixos/modules/virtualisation/hyperv-guest.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.virtualisation.hypervGuest; 7 + 8 + in { 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 + }