sigil/nixos-modules/file-systems.nix
Emery Hemingway 8c0c7d55c4 nixos: config.genode.boot.storeBackend is "fs" or "memory"
Make the config.genode.boot.storeBackend option a choice between
a traditional file-system or memory-backed file-system image. Fix
GRUB booting when using a file-system store.

The nova-ahci test shows that this is working.
2021-02-01 13:37:28 +01:00

33 lines
778 B
Nix

{ config, lib, pkgs, ... }:
with lib; {
options.fileSystems = lib.mkOption {
type = types.attrsOf (types.submodule ({ name, config, ... }: {
options.block = {
device = lib.mkOption { type = types.int; };
driver = lib.mkOption { type = types.enum [ "ahci" "usb" ]; };
partition = lib.mkOption { type = types.ints.positive; };
};
}));
};
config = {
assertions = [{
assertion = config.fileSystems."/".fsType == "ext2";
message = "The only supported fsType is EXT2";
}];
hardware.genode.ahci.enable =
any (fs: fs.block.driver == "ahci") (attrValues config.fileSystems);
hardware.genode.usb.storage.enable =
any (fs: fs.block.driver == "usb") (attrValues config.fileSystems);
};
}