-
-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathqcow-efi.nix
56 lines (49 loc) · 1.32 KB
/
qcow-efi.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
{
config,
lib,
pkgs,
modulesPath,
...
}: {
# for virtio kernel drivers
imports = [
"${toString modulesPath}/profiles/qemu-guest.nix"
];
options = {
boot = {
consoles = lib.mkOption {
default =
["ttyS0"]
++ (lib.optional (pkgs.stdenv.hostPlatform.isAarch) "ttyAMA0,115200")
++ (lib.optional (pkgs.stdenv.hostPlatform.isRiscV64) "ttySIF0,115200");
description = "Kernel console boot flags to pass to boot.kernelParams";
example = ["ttyS2,115200"];
};
};
};
config = {
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
boot.growPartition = true;
boot.kernelParams = map (c: "console=${c}") config.boot.consoles;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.timeout = 0;
system.build.qcow-efi = import "${toString modulesPath}/../lib/make-disk-image.nix" {
inherit lib config pkgs;
inherit (config.virtualisation) diskSize;
format = "qcow2";
partitionTableType = "efi";
};
formatAttr = "qcow-efi";
fileExtension = ".qcow2";
};
}