Skip to content

types: add btrfs_subvol type #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

lilyinstarlight
Copy link
Member

This adds support for specifying separate configuration and mount points for BTRFS subvolumes by implementing them as a new subtype for the btrfs type

It sort of follows from the work in #33, but does not use any of that implementation because disko has largely been rewritten since then to use types

I believe I've done everything mostly reasonably (since I copied the patterns LVM and ZFS were using for the most part), but I don't actually fully know what I'm doing, so please let me know if some things should be done differently

I've tested this by installing my new laptop from my config (see the disko config here) and via the flake checks in disko

Also of note: With the way this works, it does not create separate mountpoints if the parent btrfs filesystem has a mountpoint specified and the subvolume does not have one specified (it only gets created via btrfs subvolume create). That means this PR follows previous behavior when changing:

{
  type = "btrfs";
  mountpoint = "/";
  subvolumes = [
    "/home"
    "/nix"
    "/test"
  ];
}

to:

{
  type = "btrfs";
  mountpoint = "/";
  subvolumes = {
    "/home" = {};
    "/nix" = {};
    "/test" = {};
  };
}

even though changing the type is a breaking change.

@Lassulus Lassulus force-pushed the feature/btrfs-subvolume-types branch from cda0ccd to 77c8f64 Compare December 23, 2022 19:27
@Lassulus Lassulus merged commit 11d5c74 into nix-community:master Dec 23, 2022
@lilyinstarlight lilyinstarlight deleted the feature/btrfs-subvolume-types branch December 23, 2022 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants