Add bcachefs type with encryption and multi-disk support

This update introduces a bcachefs type with encryption support and advanced formatting options.
It includes a new example (`examples/bcachefs-multi-disk.nix`) to demonstrate multi-disk setups and available options.

Key changes:

- Deterministic UUID generation.
- Addressed limitations with multi-disk root setups due to bcachefs and systemd issues.
- Provided a systemd-mount alternative for fileSystems configuration.
- Added subvolume support and updated scripts for clarity and functionality.

---------

Co-authored-by: Jonas Heinrich <onny@project-insanity.org>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Kyle Petryszak <6314611+ProjectInitiative@users.noreply.github.com>

Update
* Add examples
* Improve descriptions

Remove debugging

Remove comment

Use `unique` to dedup lists
This commit is contained in:
nothingnesses authored and Jörg Thalheim committed 2025-04-24 13:41:42 +00:00
1 parent c5140c6079
commit ca27b88c88
6 files changed
+698 -14

No files matched your search

+9
View File
@@ -44,6 +44,7 @@ let
# option for valid contents of partitions (basically like devices, but without tables)
_partitionTypes = {
inherit (diskoLib.types)
bcachefs
btrfs
filesystem
zfs
@@ -69,6 +70,7 @@ let
# option for valid contents of devices
_deviceTypes = {
inherit (diskoLib.types)
bcachefs
table
gpt
btrfs
@@ -611,6 +613,7 @@ let
let
devices = {
inherit (cfg.config)
bcachefs_filesystems
disk
mdadm
zpool
@@ -621,6 +624,11 @@ let
in
{
options = {
bcachefs_filesystems = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.bcachefs_filesystem;
default = { };
description = "bcachefs filesystem";
};
disk = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.disk;
default = { };
@@ -687,6 +695,7 @@ let
throw "No disks defined, did you forget to import your disko config?"
else
v;
# @todo Do we need to add bcachefs-tools or not?
destroyDependencies = with pkgs; [
util-linux
e2fsprogs