write first gen impermanence disko-config
This commit is contained in:
+41
-30
@@ -1,53 +1,64 @@
|
|||||||
|
{ disks ? [ "/dev/nvme0n1" ], ... }:
|
||||||
{
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
vdb = {
|
x = {
|
||||||
|
device = builtins.elemAt disks 0;
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = "/dev/nvme0n1";
|
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
|
# boot
|
||||||
ESP = {
|
ESP = {
|
||||||
priority = 1;
|
start = "1MiB";
|
||||||
name = "ESP";
|
end = "500MiB";
|
||||||
start = "1M";
|
bootable = true;
|
||||||
end = "128M";
|
|
||||||
type = "EF00";
|
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "vfat";
|
format = "vfat";
|
||||||
mountpoint = "/boot";
|
mountpoint = "/boot";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
root = {
|
# root
|
||||||
|
zfs = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
content = {
|
content = {
|
||||||
type = "btrfs";
|
type = "zfs";
|
||||||
extraArgs = [ "-f" ]; # Override existing partition
|
pool = "zroot";
|
||||||
# Subvolumes must set a mountpoint in order to be mounted,
|
|
||||||
# unless their parent is mounted
|
|
||||||
subvolumes = {
|
|
||||||
# Subvolume name is different from mountpoint
|
|
||||||
"/rootfs" = {
|
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
# Subvolume name is the same as the mountpoint
|
|
||||||
"/home" = {
|
|
||||||
mountOptions = [ "compress=zstd" ];
|
|
||||||
mountpoint = "/home";
|
|
||||||
};
|
|
||||||
# Sub(sub)volume doesn't need a mountpoint as its parent is mounted
|
|
||||||
"/home/elliott" = { };
|
|
||||||
# Parent is not mounted so the mountpoint must be set
|
|
||||||
"/nix" = {
|
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
|
||||||
mountpoint = "/nix";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
zroot = {
|
||||||
|
type = "zpool";
|
||||||
|
mode = "mirror";
|
||||||
|
options.cachefile = "none";
|
||||||
|
rootFsOptions = {
|
||||||
|
compression = "zstd";
|
||||||
|
"com.sun:auto-snapshot" = "false";
|
||||||
|
};
|
||||||
|
moutpoint = "/";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
|
||||||
|
|
||||||
mountpoint = "/partition-root";
|
datasets = {
|
||||||
|
"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";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user