f2fs: init

This commit is contained in:
matthewcroughan 2024-08-20 10:21:58 +01:00
parent 4e719b38fa
commit cc86fe1a7c
3 changed files with 51 additions and 0 deletions

34
example/f2fs.nix Normal file
View file

@ -0,0 +1,34 @@
{
disko.devices = {
disk = {
main = {
device = "/dev/disk/by-path/pci-0000:02:00.0-nvme-1";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
end = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
end = "-0";
content = {
type = "filesystem";
format = "f2fs";
mountpoint = "/";
};
};
};
};
};
};
};
}

View file

@ -90,6 +90,7 @@
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 if (config.format == "f2fs") then [ pkgs.f2fs-tools ]
else [ ]
);
description = "Packages";

16
tests/f2fs.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> { }
, diskoLib ? pkgs.callPackage ../lib { }
}:
diskoLib.testLib.makeDiskoTest {
inherit pkgs;
name = "f2fs";
disko-config = ../example/f2fs.nix;
extraTestScript = ''
machine.succeed("mountpoint /");
machine.succeed("lsblk --fs >&2");
'';
# so that the installer boots with a f2fs enabled kernel
extraInstallerConfig = {
boot.supportedFilesystems = [ "f2fs" ];
};
}