nixos: add file-systems options
parent
1bb05f7e57
commit
74ea4d0c12
@ -0,0 +1,29 @@
|
||||
{ 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);
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue