Files
homelab-config/nixos/disk-config.nix
T

70 lines
1.7 KiB
Nix
Raw Normal View History

2025-04-09 15:27:53 -05:00
{
disko.devices = {
2025-04-09 15:55:54 -05:00
disk = {
2025-04-27 14:53:57 -05:00
x = {
device = "/dev/nvme0n1";
2025-04-09 15:55:54 -05:00
type = "disk";
content = {
type = "gpt";
2025-04-09 15:55:54 -05:00
partitions = {
2025-04-27 14:53:57 -05:00
# boot
2025-04-09 15:55:54 -05:00
ESP = {
size = "64M";
type = "EF00";
2025-04-09 15:55:54 -05:00
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
2025-04-09 15:55:54 -05:00
};
2025-04-09 15:27:53 -05:00
};
2025-04-27 14:53:57 -05:00
# root
zfs = {
2025-04-09 15:55:54 -05:00
size = "100%";
content = {
2025-04-27 14:53:57 -05:00
type = "zfs";
pool = "zroot";
2025-04-09 15:55:54 -05:00
};
2025-04-09 15:27:53 -05:00
};
};
};
};
};
2025-04-27 14:53:57 -05:00
zpool = {
zroot = {
type = "zpool";
options.cachefile = "none";
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
};
# what should I be making a snapshot of here?!!!!
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zpool/local/zroot@blank$' || zfs snapshot zpool/local/zroot@blank";
2025-04-27 14:53:57 -05:00
datasets = {
2025-04-27 14:59:10 -05:00
"root" = {
type = "zfs_fs";
options.mountpoint = "/";
mountpoint = "/";
};
2025-04-27 14:53:57 -05:00
"nix" = {
type = "zfs_fs";
options.mountpoint = "/local/nix";
mountpoint = "/local/nix";
};
"home" = {
type = "zfs_fs";
options.mountpoint = "/safe/home";
mountpoint = "/safe/home";
};
"persist" = {
type = "zfs_fs";
options.mountpoint = "/safe/persist";
mountpoint = "/safe/persist";
};
};
};
};
2025-04-09 15:27:53 -05:00
};
}