link lxd preseed to zfs volume
This commit is contained in:
parent
f3f50b051a
commit
4c1e243555
|
@ -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 = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
x = {
|
x = {
|
||||||
|
@ -45,13 +57,13 @@
|
||||||
"xattr" = "sa";
|
"xattr" = "sa";
|
||||||
"ashift" = "13";
|
"ashift" = "13";
|
||||||
};
|
};
|
||||||
mountpoint = "/mnt/zfs";
|
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";
|
size = "10G -s";
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "ext4";
|
format = "ext4";
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
storage_pool = {
|
storage_pool = {
|
||||||
name = "test";
|
name = "postgres";
|
||||||
driver = "zfs";
|
driver = "disk";
|
||||||
config.source = "zspeed/test";
|
config.source = "/mnt/postgres";
|
||||||
};
|
};
|
||||||
|
|
||||||
profile = {
|
profile = {
|
||||||
|
|
|
@ -17,6 +17,9 @@ in
|
||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
|
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
|
||||||
|
|
||||||
|
# Zfs disk configuration
|
||||||
|
../common/disks/zfs/zspeed.nix
|
||||||
|
|
||||||
# Import core options
|
# Import core options
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../common/core
|
../common/core
|
||||||
|
|
Loading…
Reference in New Issue