mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
ff5127ea0a
Originally this was manually applied with; ```sh nixpkgs-fmt **.nix && statix fix ``` but I overlooked the fact that `**.nix` would only expand to files in the root (I should have used `**/*.nix`). Previous commit adds `nix fmt` support which passes `.` to `nixpkgs-fmt` (if no other path is explicitly specified when running `nix fmt`). This commit includes the changes made by running `nix fmt`.
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
{ disks ? [ "/dev/vdb" ], ... }: {
|
|
disk = {
|
|
vdb = {
|
|
type = "disk";
|
|
device = builtins.elemAt disks 0;
|
|
content = {
|
|
type = "table";
|
|
format = "gpt";
|
|
partitions = [
|
|
{
|
|
type = "partition";
|
|
name = "ESP";
|
|
start = "1MiB";
|
|
end = "128MiB";
|
|
fs-type = "fat32";
|
|
bootable = true;
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
};
|
|
}
|
|
{
|
|
name = "root";
|
|
type = "partition";
|
|
start = "128MiB";
|
|
end = "100%";
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = "-f"; # Override existing partition
|
|
subvolumes = {
|
|
# Subvolume name is different from mountpoint
|
|
"/rootfs" = {
|
|
mountpoint = "/";
|
|
};
|
|
# Mountpoints inferred from subvolume name
|
|
"/home" = {
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"/nix" = {
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
};
|
|
"/test" = { };
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|