diff options
author | Matthew Justin Bauer <mjbauer95@gmail.com> | 2018-04-21 14:53:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 14:53:23 -0500 |
commit | 1eea73eaa8185bd6f4fe2a0facc90652277ea399 (patch) | |
tree | fa5e6aaccbdf1ef9f4e71d0f74225252a5c2168c /nixos/modules/virtualisation/hyperv-guest.nix | |
parent | e70d293b6b5f236d69d559ccccdafba19c6d29c3 (diff) | |
parent | 17b73ff90cf9f7631e543d880540441bdf56d719 (diff) | |
download | nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.tar nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.tar.gz nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.tar.bz2 nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.tar.lz nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.tar.xz nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.tar.zst nixlib-1eea73eaa8185bd6f4fe2a0facc90652277ea399.zip |
Merge branch 'master' into feat/acme/delay
Diffstat (limited to 'nixos/modules/virtualisation/hyperv-guest.nix')
-rw-r--r-- | nixos/modules/virtualisation/hyperv-guest.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/hyperv-guest.nix b/nixos/modules/virtualisation/hyperv-guest.nix new file mode 100644 index 000000000000..ecd2a8117710 --- /dev/null +++ b/nixos/modules/virtualisation/hyperv-guest.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.virtualisation.hypervGuest; + +in { + options = { + virtualisation.hypervGuest = { + enable = mkEnableOption "Hyper-V Guest Support"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ config.boot.kernelPackages.hyperv-daemons.bin ]; + + security.rngd.enable = false; + + # enable hotadding memory + services.udev.packages = lib.singleton (pkgs.writeTextFile { + name = "hyperv-memory-hotadd-udev-rules"; + destination = "/etc/udev/rules.d/99-hyperv-memory-hotadd.rules"; + text = '' + ACTION="add", SUBSYSTEM=="memory", ATTR{state}="online" + ''; + }); + + systemd = { + packages = [ config.boot.kernelPackages.hyperv-daemons.lib ]; + + targets.hyperv-daemons = { + wantedBy = [ "multi-user.target" ]; + }; + }; + }; +} |