nixos-config/scripts/disko-config-cream.nix

105 lines
2.3 KiB
Nix
Raw Normal View History

2023-02-13 18:40:56 +01:00
# nix run github:nix-community/disko -- --mode create ./disko-config-cream.nix --dry-run
# nix run github:nix-community/disko -- --mode mount ./disko-config-cream.nix --dry-run
# nixos-generate-config --root /mnt/
# vim /mnt/configuration.nix
# nixos-install --root /mnt
{ ... }:
{
disk = {
nvme0n1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "ESP";
start = "1MiB";
end = "500MiB";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
}
{
type = "partition";
name = "luks";
start = "500MiB";
end = "100%";
content = {
type = "luks";
name = "pool";
#keyFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "pool";
};
};
}
];
};
};
sdb = {
type = "disk";
device = "/dev/sdb";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "removable";
start = "1MiB";
end = "100%";
bootable = false;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/removable";
mountOptions = [
"defaults"
];
};
}
];
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
type = "lvm_lv";
2023-02-24 02:01:18 +01:00
size = "200G";
2023-02-13 18:40:56 +01:00
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
};
home = {
type = "lvm_lv";
2023-02-24 02:01:18 +01:00
size = "250G";
2023-02-13 18:40:56 +01:00
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
};
};
};
};
};
}