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 = { disko.devices = {
disk = { disk = {
x = { x = {
@ -50,31 +38,29 @@ let
zspeed = { zspeed = {
type = "zpool"; type = "zpool";
mode = "mirror"; mode = "mirror";
options = { rootFsOptions = {
"compression" = "zstd-4"; "compression" = "zstd-4";
"com.sun:auto-snapshot" = "false"; "com.sun:auto-snapshot" = "false";
"atime" = "off";
"xattr" = "sa"; "xattr" = "sa";
"atime" = "off";
};
options = {
"ashift" = "13"; "ashift" = "13";
}; };
mountpoint = "/mnt/zpool";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zspeed@blank$' || zfs snapshot zspeed@blank"; postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zspeed@blank$' || zfs snapshot zspeed@blank";
datasets = { datasets = {
postgres = { postgres = {
type = "zfs_volume"; type = "zfs_volume";
size = "10G -s"; size = "10G -s";
options = {
"com.sun:auto-snapshot:daily" = "true";
"volblocksize" = "8k";
};
content = { content = {
type = "filesystem"; type = "filesystem";
format = "ext4"; format = "ext4";
mountpoint = "/mnt/postgres"; mountpoint = "/postgres";
options = {
"com.sun:auto-snapshot:daily" = "true";
"atime" = "off";
"xattr" = "sa";
"ashift" = "13";
"recordsize" = "8k";
};
}; };
}; };
}; };