blob: d1a1d903bd5fc88695beefbc7361f1b7dc399c3d (
plain)
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
|
# Example to create a bios compatible gpt partition
{ lib, ... }:
{
# Disk /dev/sda: 200 GiB, 214748364800 bytes, 419430400 sectors
# Disk model: QEMU HARDDISK
# Units: sectors of 1 * 512 = 512 bytes
# Sector size (logical/physical): 512 bytes / 512 bytes
# I/O size (minimum/optimal): 512 bytes / 512 bytes
# Disklabel type: gpt
# Disk identifier: CED6435C-56EF-4699-BEE9-19280C444BCA
#
# Device Start End Sectors Size Type
# /dev/sda1 2048 4095 2048 1M BIOS boot
# /dev/sda2 4096 4194303 4190208 2G Linux filesystem
# /dev/sda3 4194304 419428351 415234048 198G Linux filesystem
#
disko.devices = {
disk.disk1 = {
device = lib.mkDefault "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%"; # Allocates the remainder of the disk, minus the sizes of the other partitions
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
}
|