link lxd preseed to zfs volume

This commit is contained in:
mrsu 2024-06-29 16:21:28 +01:00
parent f3f50b051a
commit 4c1e243555
3 changed files with 21 additions and 6 deletions

View File

@ -1,4 +1,16 @@
{
{ 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 = {
@ -45,13 +57,13 @@
"xattr" = "sa";
"ashift" = "13";
};
mountpoint = "/mnt/zfs";
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";
size = "10G -s";
content = {
type = "filesystem";
format = "ext4";

View File

@ -10,9 +10,9 @@
};
storage_pool = {
name = "test";
driver = "zfs";
config.source = "zspeed/test";
name = "postgres";
driver = "disk";
config.source = "/mnt/postgres";
};
profile = {

View File

@ -17,6 +17,9 @@ in
inputs.disko.nixosModules.disko
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
# Zfs disk configuration
../common/disks/zfs/zspeed.nix
# Import core options
./hardware-configuration.nix
../common/core