30 lines
656 B
Nix
30 lines
656 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" ]; };
|
||
|
|
||
|
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);
|
||
|
};
|
||
|
|
||
|
}
|