diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..5a95260 --- /dev/null +++ b/bors.toml @@ -0,0 +1,28 @@ +cut_body_after = "" # don't include text from the PR body in the merge commit message +status = [ + # garnix + "Evaluate flake.nix", + "package disko [x86_64-linux]", + "check boot-raid1 [x86_64-linux]", + "check bcachefs [x86_64-linux]", + "check luks-lvm [x86_64-linux]", + "check mdadm [x86_64-linux]", + "check lvm-luks-example-tsp-mount [x86_64-linux]", + "package default [x86_64-linux]", + "check lvm-luks-example-tsp-create [x86_64-linux]", + "check cli [x86_64-linux]", + "check btrfs-subvolumes [x86_64-linux]", + "check multi-device-no-deps [x86_64-linux]", + "check negative-size [x86_64-linux]", + "check swap [x86_64-linux]", + "check module [x86_64-linux]", + "check zfs [x86_64-linux]", + "check zfs-over-legacy [x86_64-linux]", + "check with-lib [x86_64-linux]", + "check complex [x86_64-linux]", + "check gpt-bios-compat [x86_64-linux]", + "check lvm-raid [x86_64-linux]", + "check standalone [x86_64-linux]", + "check tmpfs [x86_64-linux]", + "check simple-efi [x86_64-linux]" +] diff --git a/example/bcachefs.nix b/example/bcachefs.nix new file mode 100644 index 0000000..a98c42a --- /dev/null +++ b/example/bcachefs.nix @@ -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 = "/"; + }; + } + ]; + }; + }; + }; +} + diff --git a/flake.lock b/flake.lock index 45dc98e..12d9acf 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/tests/bcachefs.nix b/tests/bcachefs.nix new file mode 100644 index 0000000..58ca8d3 --- /dev/null +++ b/tests/bcachefs.nix @@ -0,0 +1,18 @@ +{ pkgs ? (import { }) +, 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 = [];});} + )]; + }; +} diff --git a/types.nix b/types.nix index 2e077b2..3eeb14b 100644 --- a/types.nix +++ b/types.nix @@ -514,8 +514,9 @@ rec { fs.${config.mountpoint} = '' if ! findmnt ${dev} "/mnt${config.mountpoint}" > /dev/null 2>&1; then mount ${dev} "/mnt${config.mountpoint}" \ - ${concatMapStringsSep " " (opt: "-o ${opt}") config.mountOptions} \ - -o X-mount.mkdir + -t "${config.format}" \ + ${concatMapStringsSep " " (opt: "-o ${opt}") config.mountOptions} \ + -o X-mount.mkdir fi ''; }; @@ -544,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 [] ); };