add disko

This commit is contained in:
zack 2025-05-23 19:48:46 -04:00
parent c6be10a9b7
commit 0c30b1ed0d
No known key found for this signature in database
GPG key ID: EE8A2B709E2401D1
2 changed files with 107 additions and 3 deletions

View file

@ -6,7 +6,7 @@
config,
...
}: {
imports = [./hardware-configuration.nix];
imports = [./disk-config.nix ./hardware-configuration.nix];
nix.settings = {
trusted-users = ["zoey"];
@ -50,8 +50,6 @@
};
};
documentation.man.generateCaches = false;
services.gdm-monitors.enable = true;
specialisation = {

View file

@ -0,0 +1,106 @@
{
disko.devices = {
disk = {
root = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["nofail"];
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
backup = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zbackup";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
rootFsOptions = {
mountpoint = "none";
compression = "zstd";
acltype = "posixacl";
xattr = "sa";
"com.sun:auto-snapshot" = "true";
};
options.ashift = "12";
datasets = {
"root" = {
type = "zfs_fs";
mountpoint = "/";
};
"root/nix" = {
type = "zfs_fs";
options.mountpoint = "/nix";
mountpoint = "/nix";
};
# README MORE: https://wiki.archlinux.org/title/ZFS#Swap_volume
"root/swap" = {
type = "zfs_volume";
size = "32G";
content = {
type = "swap";
};
options = {
volblocksize = "4096";
compression = "zle";
logbias = "throughput";
sync = "always";
primarycache = "metadata";
secondarycache = "none";
"com.sun:auto-snapshot" = "false";
};
};
};
};
zbackup = {
type = "zpool";
rootFsOptions = {
mountpoint = "none";
compression = "zstd";
acltype = "posixacl";
xattr = "sa";
};
options.ashift = "12";
datasets = {
"root" = {
type = "zfs_fs";
mountpoint = "/mnt/zbk";
};
};
};
};
};
}