mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-07 06:31:12 +02:00
* Use VZMacKeyboardConfiguration when possible * Use VZMacTrackpadConfiguration when possible
42 lines
945 B
Swift
42 lines
945 B
Swift
import Virtualization
|
|
|
|
@available(macOS 13, *)
|
|
struct Linux: Platform {
|
|
func os() -> OS {
|
|
.linux
|
|
}
|
|
|
|
func bootLoader(nvramURL: URL) throws -> VZBootLoader {
|
|
let result = VZEFIBootLoader()
|
|
|
|
result.variableStore = VZEFIVariableStore(url: nvramURL)
|
|
|
|
return result
|
|
}
|
|
|
|
func platform(nvramURL: URL) throws -> VZPlatformConfiguration {
|
|
VZGenericPlatformConfiguration()
|
|
}
|
|
|
|
func graphicsDevice(vmConfig: VMConfig) -> VZGraphicsDeviceConfiguration {
|
|
let result = VZVirtioGraphicsDeviceConfiguration()
|
|
|
|
result.scanouts = [
|
|
VZVirtioGraphicsScanoutConfiguration(
|
|
widthInPixels: vmConfig.display.width,
|
|
heightInPixels: vmConfig.display.height
|
|
)
|
|
]
|
|
|
|
return result
|
|
}
|
|
|
|
func keyboards() -> [VZKeyboardConfiguration] {
|
|
[VZUSBKeyboardConfiguration()]
|
|
}
|
|
|
|
func pointingDevices() -> [VZPointingDeviceConfiguration] {
|
|
[VZUSBScreenCoordinatePointingDeviceConfiguration()]
|
|
}
|
|
}
|