-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
54 lines (46 loc) · 1.49 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
description = "NixOS in MicroVMs";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
inputs.microvm.url = "github:astro/microvm.nix";
inputs.microvm.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, microvm }:
let
system = "x86_64-linux";
in {
defaultPackage.${system} = self.packages.${system}.my-microvm;
packages.${system} = {
my-microvm = microvm.lib.runner {
inherit system;
hypervisor = "firecracker";
interfaces = [
{
type = "tap";
id = "tap0";
mac = "76:49:c4:2a:48:50";
}
];
nixosConfig = let pkgs = nixpkgs.legacyPackages.${system}; in
(import ./nix/guest.nix)
{
inherit pkgs;
hostName = "nomad-op-1";
rootPassword = "changeme";
} // {
boot.postBootCommands = ''
systemctl mask mount-pstore.service
'';
};
volumes = [
{
mountpoint = "/var";
image = "var.img";
size = 5000;
}
];
mem = 4096;
vcpu = 4;
socket = "firecracker.socket";
};
};
};
}