flake / flake (push) Successful in 6m35s
nix-builder (aarch64-linux) Build completed successfully
nix-builder (x86_64-linux) Build completed successfully
72 lines
1.9 KiB
Nix
72 lines
1.9 KiB
Nix
{
|
|
disko.devices = {
|
|
disk = {
|
|
disk0 = {
|
|
type = "disk";
|
|
device = "/dev/vda";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ESP = {
|
|
size = "512M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [ "umask=0077" ];
|
|
};
|
|
};
|
|
|
|
swap = {
|
|
size = "5G";
|
|
content = {
|
|
type = "swap";
|
|
randomEncryption = true;
|
|
discardPolicy = "both";
|
|
};
|
|
};
|
|
|
|
disk0-crypt = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "disk0-crypt";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
|
|
content = {
|
|
type = "btrfs";
|
|
|
|
postCreateHook = ''
|
|
MNTPOINT=$(mktemp -d)
|
|
mount "/dev/mapper/disk0-crypt" "$MNTPOINT" -o subvol=/
|
|
trap 'umount $MNTPOINT; rm -rf $MNTPOINT' EXIT
|
|
btrfs subvolume snapshot -r $MNTPOINT/root $MNTPOINT/root-blank
|
|
'';
|
|
|
|
subvolumes = {
|
|
"/root" = {
|
|
mountpoint = "/";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"/data" = {
|
|
mountpoint = "/data";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"/nix" = {
|
|
mountpoint = "/nix";
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|