From cb5748f03a8c1c6720ff504a90eba7b78b36f76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 29 Dec 2022 18:54:20 +0100 Subject: [PATCH 1/3] mount filesystems with the correct type flag --- types.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types.nix b/types.nix index c0d18d0..54b280e 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 ''; }; From eca7cb9132e749092230a9d5ef4306bea039a6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 29 Dec 2022 18:46:31 +0100 Subject: [PATCH 2/3] bcachefs support --- example/bcachefs.nix | 39 +++++++++++++++++++++++++++++++++++++++ flake.lock | 6 +++--- tests/bcachefs.nix | 18 ++++++++++++++++++ types.nix | 1 + 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 example/bcachefs.nix create mode 100644 tests/bcachefs.nix 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 54b280e..c41f09e 100644 --- a/types.nix +++ b/types.nix @@ -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 [] ); }; From dcc80387d2b4a3dcf791e2e0a1928a6b7c8c4210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 4 Jan 2023 09:54:32 +0100 Subject: [PATCH 3/3] add bors.toml --- bors.toml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 bors.toml 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]" +]