crosvm/default.nix
Davíð Steinn Geirsson 396b3cd606 Add PulseAudio backend for virtio-snd
Implement a PulseAudio audio backend as an alternative to CRAS for Linux
desktop environments. This enables crosvm audio output on systems running
PulseAudio without requiring ChromeOS audio infrastructure.

Key components:
- pulse_audio: crosvm device implementing AsyncPlaybackBufferStream with
  push/pull bridge, connection management with auto-reconnect, and sample
  format mapping
- pulseaudio-rs: Pure Rust PulseAudio protocol implementation (third_party)
- seccomp: PulseAudio device policies for sandboxed operation
- Configuration options: pulse_socket_path, pulse_cookie_path,
  pulse_debug_file_output

Features audio_pulse feature flag to enable the backend.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 16:44:53 +00:00

69 lines
1.1 KiB
Nix

# Based on nixpkgs, but using local source.
{
lib,
rustPlatform,
fetchgit,
pkg-config,
protobuf,
python3,
wayland-scanner,
libcap,
libdrm,
libepoxy,
minijail,
virglrenderer,
wayland,
wayland-protocols,
}:
rustPlatform.buildRustPackage {
pname = "crosvm";
version = "dsg-2026-02-03_00";
src = ./.;
separateDebugInfo = true;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [
pkg-config
protobuf
python3
rustPlatform.bindgenHook
wayland-scanner
];
buildInputs = [
libcap
libdrm
libepoxy
minijail
virglrenderer
wayland
wayland-protocols
];
preConfigure = ''
patchShebangs third_party/minijail/tools/*.py
'';
CROSVM_USE_SYSTEM_MINIGBM = true;
CROSVM_USE_SYSTEM_VIRGLRENDERER = true;
buildFeatures = [ "virgl_renderer" "audio_pulse" ];
meta = with lib; {
description = "Secure virtual machine monitor for KVM";
homepage = "https://crosvm.dev/";
mainProgram = "crosvm";
maintainers = with maintainers; [ qyliss ];
license = licenses.bsd3;
platforms = [
"aarch64-linux"
"riscv64-linux"
"x86_64-linux"
];
};
}