disko/example/with-lib.nix

28 lines
631 B
Nix
Raw Permalink Normal View History

2022-10-21 12:43:55 +00:00
# Example to create a bios compatible gpt partition
{ disks ? [ "/dev/vdb" ], lib, ... }: {
disko.devices = {
disk = lib.genAttrs disks (device: {
name = lib.replaceStrings [ "/" ] [ "_" ] device;
device = device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
});
};
2022-10-21 12:43:55 +00:00
}