fa09e0a3c7
Enable using an erofs filesystem as one of the filesystems needed to boot the system. This is useful for example in image based deployments where the Nix store is mounted read only. [erofs](https://docs.kernel.org/filesystems/erofs.html) offers multiple benefits over older filesystems like squashfs. Skip fsck.erofs because it is still experimental.
21 lines
505 B
Nix
21 lines
505 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
inInitrd = lib.any (fs: fs == "erofs") config.boot.initrd.supportedFilesystems;
|
|
inSystem = lib.any (fs: fs == "erofs") config.boot.supportedFilesystems;
|
|
|
|
in
|
|
|
|
{
|
|
config = lib.mkIf (inInitrd || inSystem) {
|
|
|
|
system.fsPackages = [ pkgs.erofs-utils ];
|
|
|
|
boot.initrd.availableKernelModules = lib.mkIf inInitrd [ "erofs" ];
|
|
|
|
# fsck.erofs is currently experimental and should not be run as a
|
|
# privileged user. Thus, it is not included in the initrd.
|
|
|
|
};
|
|
}
|