system/disko/luks-btrfs.nix
Dmitriy Pleshevskiy b703b69513
host/asus: use disk to create btrfs luks encrypted
- make: fix rollback command
- flake.lock: add disko module.
- flake.lock: add impermanence module.
- disko: add configuration to create luks-btrfs schema.
- host/asus: add new filesystem configuration (luks-btrfs)
- host/asus: mount user from old partition.
- host/asus: add impermanence module to store system configuration.
2024-05-27 16:28:28 +03:00

63 lines
1.8 KiB
Nix

{ device, memSize ? 1024 * 5, swapSize ? "10G" }:
{
disko = {
inherit memSize;
devices = {
disk = {
main = {
type = "disk";
inherit device;
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
priority = 1;
};
cryptoroot = {
size = "100%";
content = {
type = "luks";
name = "luksroot";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
root = {
mountpoint = "/";
mountOptions = [ "compress=zstd" ];
};
persistent = {
mountpoint = "/persistent";
mountOptions = [ "compress=zstd" "noatime" ];
};
nix = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
swap = {
mountpoint = "/.swapvol";
mountOptions = [ "noatime" ];
swap.swapfile.size = swapSize;
};
};
};
};
};
};
};
};
};
};
};
}