Clean branch
This commit is contained in:
commit
de986accc2
42 changed files with 1959 additions and 0 deletions
88
linux/blitzar/disko.nix
Normal file
88
linux/blitzar/disko.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{ ... }: {
|
||||
disko.devices = {
|
||||
# Partition the physical disk
|
||||
disk = {
|
||||
storage = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "esp";
|
||||
start = "2MiB";
|
||||
end = "2GiB";
|
||||
fs-type = "fat32";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zfs";
|
||||
start = "2GiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Construct the primary zfs pool for this system.
|
||||
zpool.zroot = {
|
||||
type = "zpool";
|
||||
options = {
|
||||
ashift = "12";
|
||||
autotrim = "on";
|
||||
listsnapshots = "on";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posix";
|
||||
atime = "off";
|
||||
compression = "zstd";
|
||||
dnodesize = "auto";
|
||||
mountpoint = "none";
|
||||
normalization = "formD";
|
||||
xattr = "sa";
|
||||
};
|
||||
datasets = {
|
||||
# Encrypt main dataset
|
||||
main = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
encryption = "on";
|
||||
keyformat = "passphrase";
|
||||
};
|
||||
};
|
||||
# Create dataset for home
|
||||
"main/home" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/home";
|
||||
};
|
||||
# Create dataset for nix store
|
||||
"main/nix" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
# Create dataset for root
|
||||
"main/root" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
# Reserve space for performance
|
||||
reservation = {
|
||||
type = "zfs_fs";
|
||||
options.refreservation = "256G";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue