working zfs create disko config

This commit is contained in:
Sam 2024-06-29 17:18:30 +01:00
parent 4c1e243555
commit 15578fc3af
1 changed files with 10 additions and 24 deletions

View File

@ -1,16 +1,4 @@
{ pkgs
, lib
, ...
}:
let
};
In your own system use something like this:
import (builtins.fetchGit {
url = "https://github.com/nix-community/disko";
ref = "master";
}) {
inherit lib;
};{
{
disko.devices = {
disk = {
x = {
@ -50,31 +38,29 @@ let
zspeed = {
type = "zpool";
mode = "mirror";
options = {
rootFsOptions = {
"compression" = "zstd-4";
"com.sun:auto-snapshot" = "false";
"atime" = "off";
"xattr" = "sa";
"atime" = "off";
};
options = {
"ashift" = "13";
};
mountpoint = "/mnt/zpool";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zspeed@blank$' || zfs snapshot zspeed@blank";
datasets = {
postgres = {
type = "zfs_volume";
size = "10G -s";
options = {
"com.sun:auto-snapshot:daily" = "true";
"volblocksize" = "8k";
};
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/mnt/postgres";
options = {
"com.sun:auto-snapshot:daily" = "true";
"atime" = "off";
"xattr" = "sa";
"ashift" = "13";
"recordsize" = "8k";
};
mountpoint = "/postgres";
};
};
};