mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
75 lines
1.6 KiB
Nix
75 lines
1.6 KiB
Nix
![]() |
{ disks ? [ "/dev/nvme0" ], ... }:
|
||
|
{
|
||
|
disk = {
|
||
|
vdb = {
|
||
|
type = "disk";
|
||
|
device = builtins.head disks;
|
||
|
content = {
|
||
|
type = "gpt";
|
||
|
partitions = {
|
||
|
boot = {
|
||
|
size = "1M";
|
||
|
type = "EF02"; # for grub MBR
|
||
|
};
|
||
|
ESP = {
|
||
|
size = "512M";
|
||
|
type = "EF00";
|
||
|
content = {
|
||
|
type = "filesystem";
|
||
|
format = "vfat";
|
||
|
mountpoint = "/boot";
|
||
|
mountOptions = [
|
||
|
"defaults"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
luks = {
|
||
|
size = "100%";
|
||
|
content = {
|
||
|
type = "luks";
|
||
|
name = "encrypted";
|
||
|
extraOpenArgs = [ "--allow-discards" ];
|
||
|
passwordFile = "/tmp/disk.key";
|
||
|
content = {
|
||
|
type = "lvm_pv";
|
||
|
vg = "pool";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
lvm_vg = {
|
||
|
pool = {
|
||
|
type = "lvm_vg";
|
||
|
lvs = {
|
||
|
root = {
|
||
|
size = "100G";
|
||
|
content = {
|
||
|
type = "filesystem";
|
||
|
format = "ext4";
|
||
|
mountpoint = "/";
|
||
|
};
|
||
|
};
|
||
|
home = {
|
||
|
size = "450G";
|
||
|
content = {
|
||
|
type = "filesystem";
|
||
|
format = "ext4";
|
||
|
mountpoint = "/home";
|
||
|
};
|
||
|
};
|
||
|
swap = {
|
||
|
size = "32G";
|
||
|
content = {
|
||
|
type = "swap";
|
||
|
randomEncryption = true;
|
||
|
resumeDevice = true;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|