]> Git — Sourcephile - sourcephile-nix.git/blob - install/physical/virtualbox.nix
init
[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 net = {
35 iface = "enp0s3";
36 ipv4 = ipv4;
37 };
38 lan = {
39 iface = "enp0s8";
40 ipv4 = ipv4;
41 #ipv6 = "fe80::1";
42 };
43 };
44 };
45 };
46 }