refactor
This commit is contained in:
parent
8c9eed18e6
commit
b458b67238
83 changed files with 1115 additions and 5026 deletions
96
hosts/nullstar/hardware/disko.nix
Normal file
96
hosts/nullstar/hardware/disko.nix
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
# Disable this if you do not want to allow TRIM requests to pass through LUKS
|
||||
# (Security vs SSD longevity trade-off)
|
||||
settings.allowDiscards = true;
|
||||
# Uncomment if you want to use a keyfile during install:
|
||||
# settings.keyFile = "/tmp/secret.key";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
zroot = {
|
||||
type = "zpool";
|
||||
options = {
|
||||
ashift = "12";
|
||||
autotrim = "on";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posixacl";
|
||||
xattr = "sa";
|
||||
dnodesize = "auto";
|
||||
compression = "zstd";
|
||||
normalization = "formD";
|
||||
relatime = "on";
|
||||
canmount = "off";
|
||||
# Prevent auto-snapshotting by default (enable explicitly on datasets that need it)
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
datasets = {
|
||||
# The ephemeral root dataset.
|
||||
# We create a blank snapshot immediately so you can rollback to it on boot.
|
||||
"root" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
options.mountpoint = "legacy";
|
||||
postCreateHook = "zfs snapshot zroot/root@blank";
|
||||
};
|
||||
|
||||
# The Nix Store (reproducible, doesn't need backing up usually)
|
||||
"nix" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/nix";
|
||||
options.mountpoint = "legacy";
|
||||
options."com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
|
||||
# Persisted state (for impermanence)
|
||||
"persist" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/persist";
|
||||
options.mountpoint = "legacy";
|
||||
# Enable snapshots for data safety if using sanoid/syncoid
|
||||
# options."com.sun:auto-snapshot" = "true";
|
||||
};
|
||||
|
||||
# Home directories
|
||||
"home" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/home";
|
||||
options.mountpoint = "legacy";
|
||||
# options."com.sun:auto-snapshot" = "true";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue