]> Git — Sourcephile - sourcephile-nix.git/blob - install/physical/virtualbox.nix
update
[sourcephile-nix.git] / install / physical / virtualbox.nix
1 {
2 machine1 = {pkgs, lib, config, options, ...}:
3 let ipv4 = if options.networking.privateIPv4.isDefined
4 then config.networking.privateIPv4
5 else "X.X.X.X";
6 in
7 {
8
9 config = {
10 deployment.targetEnv = "virtualbox";
11 deployment.virtualbox.headless = true;
12 deployment.virtualbox.memorySize = 1024;
13 deployment.virtualbox.vcpu = 2;
14 deployment.virtualbox.disks.disk1.baseImage = <sys/var/virtualbox/nixops.vmdk>;
15 #deployment.virtualbox.disks.disk1.size = 6024;
16 # NOTE: resize not yet supported.
17
18 deployment.storeKeysOnMachine = true;
19 deployment.autoLuks = {
20 # NOTE: not working on virtualbox deployment
21 secretdisk = {
22 device = "/dev/sda";
23 passphrase = "foobar";
24 autoFormat = true;
25 cipher = "aes-cbc-essiv:sha256";
26 };
27 };
28 networking = {
29 interfaces."enp0s8" = {
30 #macAddress = "00:11:22:33:44:55";
31 ipv4.addresses = [ { address = ipv4; prefixLength = 32; } ];
32 ipv6.addresses = [ { address = "fe80::1"; prefixLength = 64; } ];
33 };
34 zones = {
35 net = {
36 iface = "enp0s3";
37 ipv4 = ipv4;
38 };
39 lan = {
40 iface = "enp0s8";
41 ipv4 = ipv4;
42 #ipv6 = "fe80::1";
43 };
44 };
45 };
46 };
47 };
48 }