tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
hyperv-daemons: add nixos module
Peter Hoeg
8 years ago
85e507eb
ae20c225
+38
2 changed files
expand all
collapse all
unified
split
nixos
modules
module-list.nix
virtualisation
hyperv-guest.nix
+1
nixos/modules/module-list.nix
···
746
746
./virtualisation/lxcfs.nix
747
747
./virtualisation/lxd.nix
748
748
./virtualisation/amazon-options.nix
749
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
1
+
{ config, lib, pkgs, ... }:
2
2
+
3
3
+
with lib;
4
4
+
5
5
+
let
6
6
+
cfg = config.virtualisation.hypervGuest;
7
7
+
8
8
+
in {
9
9
+
options = {
10
10
+
virtualisation.hypervGuest = {
11
11
+
enable = mkEnableOption "Hyper-V Guest Support";
12
12
+
};
13
13
+
};
14
14
+
15
15
+
config = mkIf cfg.enable {
16
16
+
environment.systemPackages = [ config.boot.kernelPackages.hyperv-daemons.bin ];
17
17
+
18
18
+
security.rngd.enable = false;
19
19
+
20
20
+
# enable hotadding memory
21
21
+
services.udev.packages = lib.singleton (pkgs.writeTextFile {
22
22
+
name = "hyperv-memory-hotadd-udev-rules";
23
23
+
destination = "/etc/udev/rules.d/99-hyperv-memory-hotadd.rules";
24
24
+
text = ''
25
25
+
ACTION="add", SUBSYSTEM=="memory", ATTR{state}="online"
26
26
+
'';
27
27
+
});
28
28
+
29
29
+
systemd = {
30
30
+
packages = [ config.boot.kernelPackages.hyperv-daemons.lib ];
31
31
+
32
32
+
targets.hyperv-daemons = {
33
33
+
wantedBy = [ "multi-user.target" ];
34
34
+
};
35
35
+
};
36
36
+
};
37
37
+
}