81 lines
2.2 KiB
Nix

{ disko, modulesPath, ... }:
{
imports = [ disko.nixosModules.disko "${modulesPath}/profiles/qemu-guest.nix" ];
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "table";
format = "msdos";
partitions = [
{
name = "ESP";
start = "1M";
end = "500M";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
}
{
name = "Midori-disk";
start = "500M";
end = "100%";
part-type = "primary";
bootable = true;
content = {
type = "luks";
name = "persistence";
settings = {
allowDiscards = true;
};
passwordFile = "/tmp/secret.key";
content = {
type = "btrfs";
subvolumes = {
"/root" = {
mountpoint = "/persistence";
mountOptions = [
# Do not write access times on files. This is a common
# practice to reduce the number of unnecessary writes
# since we don't need access times or use any program that
# needs them.
"noatime"
];
};
"/swap" = {
mountpoint = "/.swap";
swap.swapfile.size = "8G";
};
};
};
};
}
];
};
};
};
nodev."/" = {
fsType = "tmpfs";
mountOptions = [
"defaults"
"size=25%"
"mode=755"
"noatime"
];
};
};
# Regularly correct bit rot.
# Well it should correct if i had some kind of raid system
# services.btrfs.autoScrub.enable = true;
}