{ config, lib, inputs, namespace, ... }: let inherit (lib) mkIf types; inherit (lib.${namespace}) mkOpt mkBoolOpt; cfg = config.${namespace}.hardware.asahi; in { imports = [ inputs.apple-silicon.nixosModules.default ]; options.${namespace}.hardware.asahi = { enable = lib.mkEnableOption "support for asahi linux"; enableGPU = mkBoolOpt false "enable gpu driver"; firmwareDirectory = mkOpt types.path null "firmware directory"; }; config = mkIf cfg.enable { hardware = { asahi = { peripheralFirmwareDirectory = cfg.firmwareDirectory; useExperimentalGPUDriver = cfg.enableGPU; }; }; }; }