-
-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathlinode.nix
60 lines (50 loc) · 1.25 KB
/
linode.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
55
56
57
58
59
60
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
"${toString modulesPath}/virtualisation/linode-image.nix"
];
formatAttr = "linodeImage";
fileExtension = ".img.gz";
system.build.linodeImage = lib.mkForce (import "${toString modulesPath}/../lib/make-disk-image.nix" {
inherit lib config pkgs;
partitionTableType = "none";
format = "raw";
postVM = ''
${pkgs.pigz}/bin/pigz -9 $out/nixos.img
'';
});
# Enable LISH and Linode booting w/ GRUB
boot = {
growPartition = true;
loader = {
grub = {
fsIdentifier = "label";
# Link /boot/grub2 to /boot/grub:
extraInstallCommands = ''
${pkgs.coreutils}/bin/ln -fs /boot/grub /boot/grub2
'';
# Remove GRUB splash image:
splashImage = null;
};
};
};
# Hardware option detected by nixos-generate-config:
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Install diagnostic tools for Linode support:
environment.systemPackages = with pkgs; [
linode-cli
];
networking = {
enableIPv6 = true;
interfaces.eth0 = {
tempAddress = "disabled";
useDHCP = true;
};
};
services.qemuGuest.enable = true;
}