From d91e1f98fa83fecf614111b3bfde9bf2b3c3aa3d Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 22 Dec 2022 23:07:19 -0500 Subject: [PATCH] nixos: Add sd_image_minimal_new_kernel_no_zfs Support for ZFS, while desirable, is problematic with newer kernel releases. The stable ZFS release seldom supports the current newest kernel version, and this makes the new_kernel image basically useless as it cannot be published, and is not often built with new kernel releases. This uses a dirty workaround to work around the fact it is impossible to remove a list item from a modules system list type. Since ZFS support is conditional to being supported on the current platform, we can fake ZFS not being supported *for the no-zfs build only*. This overlay is only added when evaluating the image, nothing else. --- ...-image-aarch64-new-kernel-no-zfs-installer.nix | 15 +++++++++++++++ nixos/release.nix | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix diff --git a/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix b/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix new file mode 100644 index 00000000000..0e505596029 --- /dev/null +++ b/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +{ + imports = [ ./sd-image-aarch64-new-kernel-installer.nix ]; + + # Makes `availableOn` fail for zfs, see . + # This is a workaround since we cannot remove the `"zfs"` string from `supportedFilesystems`. + # The proper fix would be to make `supportedFilesystems` an attrset with true/false which we + # could then `lib.mkForce false` + nixpkgs.overlays = [(final: super: { + zfs = super.zfs.overrideAttrs(_: { + meta.platforms = []; + }); + })]; +} diff --git a/nixos/release.nix b/nixos/release.nix index 7907be3c02f..946379bcd66 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -214,6 +214,14 @@ in rec { inherit system; }); + sd_image_new_kernel_no_zfs = forMatchingSystems [ "aarch64-linux" ] (system: makeSdImage { + module = { + aarch64-linux = ./modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix; + }.${system}; + type = "minimal-new-kernel-no-zfs"; + inherit system; + }); + # A bootable VirtualBox virtual appliance as an OVA file (i.e. packaged OVF). ova = forMatchingSystems [ "x86_64-linux" ] (system: