diff --git a/systems/x86_64-linux/earth/default.nix b/systems/x86_64-linux/earth/default.nix index ff00a6f..09fb78a 100644 --- a/systems/x86_64-linux/earth/default.nix +++ b/systems/x86_64-linux/earth/default.nix @@ -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 = { diff --git a/systems/x86_64-linux/earth/disk-config.nix b/systems/x86_64-linux/earth/disk-config.nix new file mode 100644 index 0000000..2f66e4f --- /dev/null +++ b/systems/x86_64-linux/earth/disk-config.nix @@ -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"; + }; + }; + }; + }; + }; +}