sigil/nixos-modules/hardware/ahci.nix

31 lines
753 B
Nix
Raw Normal View History

2020-12-30 21:07:30 +01:00
{ config, pkgs, lib, ... }:
with lib;
{
options.hardware.genode.ahci = {
enable = lib.mkEnableOption "AHCI (SATA) block driver";
atapiSupport = lib.mkEnableOption "ATAPI support";
2020-12-30 21:07:30 +01:00
};
config = let cfg = config.hardware.genode.ahci;
in {
hardware.genode.platform.policies = lib.optional cfg.enable
(builtins.toFile ("ahci.platform-policy.dhall") ''
let Genode = env:DHALL_GENODE
in Genode.Init.Config.Policy::{
, service = "Platform"
, label = Genode.Init.LabelSelector.prefix "drivers -> ahci"
2020-12-30 21:07:30 +01:00
, content =
[ Genode.Prelude.XML.leaf
{ name = "pci", attributes = toMap { class = "AHCI" } }
]
}
'');
};
}