From cc86fe1a7c5171f1949cc76b98dbd990cfb70b0c Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Tue, 20 Aug 2024 10:21:58 +0100 Subject: [PATCH] f2fs: init --- example/f2fs.nix | 34 ++++++++++++++++++++++++++++++++++ lib/types/filesystem.nix | 1 + tests/f2fs.nix | 16 ++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 example/f2fs.nix create mode 100644 tests/f2fs.nix diff --git a/example/f2fs.nix b/example/f2fs.nix new file mode 100644 index 0000000..f5a1e8f --- /dev/null +++ b/example/f2fs.nix @@ -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 = "/"; + }; + }; + }; + }; + }; + }; + }; +} + diff --git a/lib/types/filesystem.nix b/lib/types/filesystem.nix index 4ab0f0d..8f9e80d 100644 --- a/lib/types/filesystem.nix +++ b/lib/types/filesystem.nix @@ -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"; diff --git a/tests/f2fs.nix b/tests/f2fs.nix new file mode 100644 index 0000000..ebcf8d8 --- /dev/null +++ b/tests/f2fs.nix @@ -0,0 +1,16 @@ +{ pkgs ? import { } +, 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" ]; + }; +}