Disks
The disks module can be used by importing inputs.self.nixosModules.malobeo.disko
let cfg = malobeo.disks
cfg.enable (bool)
- Type:
bool - Default:
false - Description:
Enables the disk creation process using thediskotool. Set totrueto initialize disk setup.
cfg.hostId (string)
- Type:
string - Default:
"" - Description:
The host ID used for ZFS disks. This ID should be generated using a command likehead -c4 /dev/urandom | od -A none -t x4.
cfg.encryption (bool)
- Type:
bool - Default:
true - Description:
Determines if encryption should be enabled. Set tofalseto disable encryption for testing purposes.
cfg.devNodes (string)
- Type:
string - Default:
"/dev/disk/by-id/" - Description:
Specifies where the disks should be mounted from.- Use
/dev/disk/by-id/for general systems. - Use
/dev/disk/by-path/for VMs. - For more information on disk name conventions, see OpenZFS FAQ.
- Use
let cfg = malobeo.disks.root
cfg.disk0 (string)
- Type:
string - Default:
"" - Description:
The device name (beginning after/dev/e.g.,sda) for the root filesystem.
cfg.disk1 (string)
- Type:
string - Default:
"" - Description:
The device name (beginning after/dev/e.g.,sdb) for the optional mirror disk of the root filesystem.
cfg.swap (string)
- Type:
string - Default:
"8G" - Description:
Size of the swap partition ondisk0. This is applicable only for the root disk configuration.
cfg.reservation (string)
- Type:
string - Default:
"20GiB" - Description:
The ZFS reservation size for the root pool.
cfg.mirror (bool)
- Type:
bool - Default:
false - Description:
Whether to configure a mirrored ZFS root pool. Set totrueto mirror the root filesystem acrossdisk0anddisk1.
let cfg = malobeo.disks.storage
cfg.enable (bool)
- Type:
bool - Default:
false - Description:
Enables the creation of an additional storage pool. Set totrueto create the storage pool.
cfg.disks (list of strings)
- Type:
listOf string - Default:
[] - Description:
A list of device names without /dev/ prefix (e.g.,sda,sdb) to include in the storage pool.
Example:["disks/by-id/ata-ST16000NE000-2RW103_ZL2P0YSZ"].
cfg.reservation (string)
- Type:
string - Default:
"20GiB" - Description:
The ZFS reservation size for the storage pool.
cfg.mirror (bool)
- Type:
bool - Default:
false - Description:
Whether to configure a mirrored ZFS storage pool. Set totrueto mirror the storage pool.
Example Configuration
{
options.malobeo.disks = {
enable = true;
hostId = "abcdef01";
encryption = true;
devNodes = "/dev/disk/by-id/";
root = {
disk0 = "sda";
disk1 = "sdb";
swap = "8G";
reservation = "40GiB";
mirror = true;
};
storage = {
enable = true;
disks = [ "sdc" "sdd" "disks/by-uuid/sde" ];
reservation = "100GiB";
mirror = false;
};
};
}