Add untested disko config

nix run github:nix-community/disko -- -m create --dry-run ./disko-config.nix
This commit is contained in:
Sandro - 2023-03-01 22:56:34 +01:00
parent 911a3367ca
commit f9fd5b52a9
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 114 additions and 0 deletions

114
disko-config.nix Normal file
View File

@ -0,0 +1,114 @@
{ name ? "chaos", disk ? "sda1", ... }:
{
disk = {
${disk} = {
device = "/dev/${disk}";
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "ESP";
start = "1MiB";
end = "512MiB";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
type = "partition";
name = "root";
start = "512MiB";
end = "100%";
part-type = "primary";
content = {
type = "luks";
# mountpoint = "/";
name = "crypt-${name}";
content = {
type = "lvm_pv";
vg = "lvm-${name}";
};
};
}
];
};
};
};
lvm_vg.pool = {
type = "lvm_vg";
lvs = {
zfs = {
type = "lvm_lv";
size = "200GiB";
content = {
type = "zfs";
pool = name;
};
};
raw = {
type = "lvm_lv";
size = "100%-200GiB";
};
};
};
zpool."${name}-${disk}" = {
type = "zpool";
rootFsOptions = {
acltype = "posixacl";
ashift = "12";
autotrim = "on";
canmount = "off";
compression = "zstd";
normalization = "formD";
mountpoint = "none";
xattr = "sa";
};
datasets = let
dataset = mountpoint: {
options = {
canmount = "on";
inherit mountpoint;
};
zfs_type = "filesystem";
};
in {
"data" = dataset "/";
"data/etc" = dataset "/etc";
"data/home" = dataset "/home";
"data/var" = dataset "/var";
"data/var/backup" = dataset "/var/backup";
"data/var/lib" = dataset "/var/lib";
"data/var/log" = dataset "/var/log";
"nixos" = {
options.canmount = "off";
zfs_type = "filesystem";
};
"nixos/nix" = dataset "/nix";
"nixos/nix/store" = {
options = {
atime = "off";
canmount = "on";
mountpoint = "/nix/store";
};
zfs_type = "filesystem";
};
"nixos/nix/var" = dataset "/nix/var";
"resered" = {
options = {
canmount = "off";
reservation = "5GiB";
};
zfs_type = "filesystem";
};
};
};
}