-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisko.nix
More file actions
51 lines (51 loc) · 1.7 KB
/
Copy pathdisko.nix
File metadata and controls
51 lines (51 loc) · 1.7 KB
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
# disko.nix — STANDALONE disk layout for the `disko` formatter.
#
# This is NOT a NixOS module and is intentionally NOT imported by flake.nix. It's
# consumed by the disko CLI to partition + format + mount the target disk during
# a disk install (README "Route B"):
#
# sudo nix --experimental-features 'nix-command flakes' \
# run github:nix-community/disko/latest -- --mode disko ./disko.nix
#
# The installed system mounts by LABEL (NIXROOT / NIXBOOT) via modules/disk.nix,
# so this layout stamps those labels on. That keeps the two install routes in
# sync: whether disko formats the disk or you do it by hand with the same labels,
# the system finds its root either way.
#
# Single disk, GPT, UEFI: a 512 MB EFI System partition + an ext4 root.
# Parameterized on `disk` so luna-install can format the drive you pick from its
# menu. The default (/dev/sda, VirtualBox's SATA disk) keeps the manual
# `disko --mode disko ./disko.nix` route (README Route B) working unchanged.
# NVMe = /dev/nvme0n1; virtio (plain QEMU) = /dev/vda.
{ disk ? "/dev/sda", ... }:
{
disko.devices.disk.main = {
device = disk;
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
extraArgs = [ "-n" "NIXBOOT" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
extraArgs = [ "-L" "NIXROOT" ];
};
};
};
};
};
}