85 lines
1.9 KiB
Nix
85 lines
1.9 KiB
Nix
{ 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 = {
|
|
type = "disk";
|
|
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
zfs = {
|
|
size = "100%";
|
|
content = {
|
|
type = "zfs";
|
|
pool = "zspeed";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
y = {
|
|
type = "disk";
|
|
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi3";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
zfs = {
|
|
size = "100%";
|
|
content = {
|
|
type = "zfs";
|
|
pool = "zspeed";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
zpool = {
|
|
zspeed = {
|
|
type = "zpool";
|
|
mode = "mirror";
|
|
options = {
|
|
"compression" = "zstd-4";
|
|
"com.sun:auto-snapshot" = "false";
|
|
"atime" = "off";
|
|
"xattr" = "sa";
|
|
"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";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "ext4";
|
|
mountpoint = "/mnt/postgres";
|
|
options = {
|
|
"com.sun:auto-snapshot:daily" = "true";
|
|
"atime" = "off";
|
|
"xattr" = "sa";
|
|
"ashift" = "13";
|
|
"recordsize" = "8k";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|