mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
bcachefs support
This commit is contained in:
parent
cb5748f03a
commit
eca7cb9132
4 changed files with 61 additions and 3 deletions
39
example/bcachefs.nix
Normal file
39
example/bcachefs.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ disks ? [ "/dev/vdb" ], ... }: {
|
||||
disk = {
|
||||
vdb = {
|
||||
device = builtins.elemAt disks 0;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
name = "ESP";
|
||||
start = "1MiB";
|
||||
end = "100MiB";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "root";
|
||||
type = "partition";
|
||||
start = "100MiB";
|
||||
end = "100%";
|
||||
part-type = "primary";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "bcachefs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1671788672,
|
||||
"narHash": "sha256-tLkPxJuos3jki2f/TZdHn+NuMQAzN9s2E4QudylQLg0=",
|
||||
"lastModified": 1672756850,
|
||||
"narHash": "sha256-Smbq3+fitwA13qsTMeaaurv09/KVbZfW7m7lINwzDGA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2c74fcd6c5fc14a61de158fb796243543f46b217",
|
||||
"rev": "298add347c2bbce14020fcb54051f517c391196b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
18
tests/bcachefs.nix
Normal file
18
tests/bcachefs.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ pkgs ? (import <nixpkgs> { })
|
||||
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
|
||||
}:
|
||||
makeDiskoTest {
|
||||
disko-config = ../example/bcachefs.nix;
|
||||
extraTestScript = ''
|
||||
machine.succeed("mountpoint /");
|
||||
machine.succeed("lsblk >&2");
|
||||
'';
|
||||
# so that the installer boots with a bcachefs enabled kernel
|
||||
extraConfig = {
|
||||
boot.supportedFilesystems = [ "bcachefs" ];
|
||||
# disable zfs so we can support latest kernel
|
||||
nixpkgs.overlays = [(final: super: {
|
||||
zfs = super.zfs.overrideAttrs(_: {meta.platforms = [];});}
|
||||
)];
|
||||
};
|
||||
}
|
|
@ -545,6 +545,7 @@ rec {
|
|||
else if (config.format == "ext2") then [ pkgs.e2fsprogs ]
|
||||
else if (config.format == "ext3") then [ pkgs.e2fsprogs ]
|
||||
else if (config.format == "ext4") then [ pkgs.e2fsprogs ]
|
||||
else if (config.format == "bcachefs") then [ pkgs.bcachefs-tools ]
|
||||
else []
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue