Large refactor
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# time sudo nixos-install --flake /nixos#nixos-testbed
|
||||
{ lib, ... }:
|
||||
{
|
||||
# imports = [ inputs.disko.nixosModules.disko ];
|
||||
# imports = [ disko.nixosModules.disko ];
|
||||
boot.zfs.extraPools = [ "rpool" ];
|
||||
boot.zfs.devNodes = "/dev/disk/by-path";
|
||||
boot.initrd.supportedFilesystems = [ "zfs" ];
|
||||
@@ -18,8 +18,6 @@
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "512M";
|
||||
# start = "1MiB";
|
||||
# end = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
@@ -29,8 +27,6 @@
|
||||
};
|
||||
};
|
||||
root = {
|
||||
# start = "512M";
|
||||
# end = "100%";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
@@ -44,23 +40,6 @@
|
||||
zpool = {
|
||||
rpool = {
|
||||
type = "zpool";
|
||||
|
||||
# Workaround: cannot import 'rpool': I/O error in disko tests
|
||||
# options.cachefile = "none";
|
||||
|
||||
# rootFsOptions = {
|
||||
# # I don't know.
|
||||
# # https://wiki.archlinux.org/title/Systemd#systemd-tmpfiles-setup.service_fails_to_start_at_boot
|
||||
# acltype = "posixacl";
|
||||
# # atime = "off";
|
||||
# # compression = "zstd";
|
||||
# mountpoint = "none";
|
||||
# # xattr = "sa";
|
||||
# "com.sun:auto-snapshot" = "false";
|
||||
# };
|
||||
|
||||
# mountpoint = "/";
|
||||
|
||||
datasets =
|
||||
let dataset = options:
|
||||
let default = {
|
||||
@@ -97,59 +76,16 @@
|
||||
mountpoint = "/persist/home";
|
||||
};
|
||||
"reserved" = dataset {
|
||||
mountpoint = null;
|
||||
options = {
|
||||
canmount = "off";
|
||||
mountpoint = "none";
|
||||
reservation = "5GiB";
|
||||
};
|
||||
};
|
||||
# "local" = {
|
||||
# type = "zfs_fs";
|
||||
# options.mountpoint = "none";
|
||||
# };
|
||||
# "safe" = {
|
||||
# type = "zfs_fs";
|
||||
# options.mountpoint = "none";
|
||||
# };
|
||||
# "local/root" = {
|
||||
# type = "zfs_fs";
|
||||
# options.mountpoint = "legacy";
|
||||
# mountpoint = "/";
|
||||
# options."com.sun:auto-snapshot" = "false";
|
||||
# postCreateHook = ''
|
||||
# zfs list -t snapshot -H -o name \
|
||||
# | grep -E '^rpool/local/root@blank$' \
|
||||
# || zfs snapshot rpool/local/root@blank
|
||||
# '';
|
||||
# };
|
||||
# "local/home" = {
|
||||
|
||||
# };
|
||||
# "local/nix" = {
|
||||
# type = "zfs_fs";
|
||||
# options.mountpoint = "legacy";
|
||||
# mountpoint = "/nix";
|
||||
# options."com.sun:auto-snapshot" = "false";
|
||||
# };
|
||||
# "safe/persist" = {
|
||||
# type = "zfs_fs";
|
||||
# options.mountpoint = "legacy";
|
||||
# mountpoint = "/persist";
|
||||
# options."com.sun:auto-snapshot" = "false";
|
||||
# };
|
||||
# # zfs uses copy on write and requires some free space to delete files when the disk is completely filled
|
||||
# "reserved" = lib.recursiveUpdate (dataset "reserved") {
|
||||
# mountpoint = null;
|
||||
# options = {
|
||||
# canmount = "off";
|
||||
# mountpoint = "none";
|
||||
# reservation = "5GiB";
|
||||
# };
|
||||
# type = "zfs_fs";
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user