diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-08 08:03:50 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-08 08:53:04 +0900 |
| commit | 87781c765844409226804157546753b84ef3c6b4 (patch) | |
| tree | 4fa7bdbe890979badada6c36183a2ff25b7b85a8 /cmd | |
| parent | 0c38fb7b6a17bed9392a4cf46fc752bc2de8eb18 (diff) | |
treewide: include PipeWire op and enforce PulseAudio check
This fully replaces PulseAudio with PipeWire and enforces the PulseAudio check and error message. The pipewire-pulse daemon is handled in the NixOS module.
Closes #26.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/hakurei/command.go | 12 | ||||
| -rw-r--r-- | cmd/hakurei/print_test.go | 13 | ||||
| -rw-r--r-- | cmd/hpkg/build.nix | 1 | ||||
| -rw-r--r-- | cmd/hpkg/test/test.py | 8 |
4 files changed, 18 insertions, 16 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index 63467e5f..8f20c8ed 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -14,6 +14,7 @@ import ( _ "unsafe" // for go:linkname "hakurei.app/command" + "hakurei.app/container" "hakurei.app/container/check" "hakurei.app/container/fhs" "hakurei.app/hst" @@ -149,9 +150,6 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr if flagPipeWire || flagPulse { et |= hst.EPipeWire } - if flagPulse { - et |= hst.EPulse - } config := &hst.Config{ ID: flagID, @@ -189,6 +187,14 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr }}) } + // start pipewire-pulse: this most likely exists on host if PipeWire is available + if flagPulse { + config.Container.Filesystem = append(config.Container.Filesystem, hst.FilesystemConfigJSON{FilesystemConfig: &hst.FSDaemon{ + Target: fhs.AbsRunUser.Append(strconv.Itoa(container.OverflowUid(msg)), "pulse/native"), + Exec: shell, Args: []string{"-lc", "pipewire-pulse"}, + }}) + } + config.Container.Filesystem = append(config.Container.Filesystem, // opportunistically bind kvm hst.FilesystemConfigJSON{FilesystemConfig: &hst.FSBind{ diff --git a/cmd/hakurei/print_test.go b/cmd/hakurei/print_test.go index d0c12d19..d2e5ea37 100644 --- a/cmd/hakurei/print_test.go +++ b/cmd/hakurei/print_test.go @@ -62,7 +62,7 @@ func TestPrintShowInstance(t *testing.T) { {"nil", nil, nil, false, false, "Error: invalid configuration!\n\n", false}, {"config", nil, hst.Template(), false, false, `App Identity: 9 (org.chromium.Chromium) - Enablements: wayland, dbus, pipewire, pulseaudio + Enablements: wayland, dbus, pipewire Groups: video, dialout, plugdev Flags: multiarch, compat, devel, userns, net, abstract, tty, mapuid, device, runtime, tmpdir Home: /data/data/org.chromium.Chromium @@ -159,7 +159,7 @@ Session bus App Identity: 9 (org.chromium.Chromium) - Enablements: wayland, dbus, pipewire, pulseaudio + Enablements: wayland, dbus, pipewire Groups: video, dialout, plugdev Flags: multiarch, compat, devel, userns, net, abstract, tty, mapuid, device, runtime, tmpdir Home: /data/data/org.chromium.Chromium @@ -215,8 +215,7 @@ App "enablements": { "wayland": true, "dbus": true, - "pipewire": true, - "pulse": true + "pipewire": true }, "session_bus": { "see": null, @@ -367,8 +366,7 @@ App "enablements": { "wayland": true, "dbus": true, - "pipewire": true, - "pulse": true + "pipewire": true }, "session_bus": { "see": null, @@ -566,8 +564,7 @@ func TestPrintPs(t *testing.T) { "enablements": { "wayland": true, "dbus": true, - "pipewire": true, - "pulse": true + "pipewire": true }, "session_bus": { "see": null, diff --git a/cmd/hpkg/build.nix b/cmd/hpkg/build.nix index 5e2f55ac..d994fc2d 100644 --- a/cmd/hpkg/build.nix +++ b/cmd/hpkg/build.nix @@ -176,7 +176,6 @@ let x11 = allow_x11; dbus = allow_dbus; pipewire = allow_audio; - pulse = allow_audio; }; mesa = if gpu then mesaWrappers else null; diff --git a/cmd/hpkg/test/test.py b/cmd/hpkg/test/test.py index ef6a626f..81e02814 100644 --- a/cmd/hpkg/test/test.py +++ b/cmd/hpkg/test/test.py @@ -90,13 +90,13 @@ wait_for_window("hakurei@machine-foot") machine.send_chars("clear; wayland-info && touch /tmp/success-client\n") machine.wait_for_file("/tmp/hakurei.0/tmpdir/2/success-client") collect_state_ui("app_wayland") -check_state("foot", {"wayland": True, "dbus": True, "pipewire": True, "pulse": True}) +check_state("foot", {"wayland": True, "dbus": True, "pipewire": True}) # Verify acl on XDG_RUNTIME_DIR: -print(machine.succeed("getfacl --absolute-names --omit-header --numeric /run/user/1000 | grep 10002")) +print(machine.succeed("getfacl --absolute-names --omit-header --numeric /tmp/hakurei.0/runtime | grep 10002")) machine.send_chars("exit\n") machine.wait_until_fails("pgrep foot") # Verify acl cleanup on XDG_RUNTIME_DIR: -machine.wait_until_fails("getfacl --absolute-names --omit-header --numeric /run/user/1000 | grep 10002") +machine.wait_until_fails("getfacl --absolute-names --omit-header --numeric /tmp/hakurei.0/runtime | grep 10002") # Exit Sway and verify process exit status 0: swaymsg("exit", succeed=False) @@ -107,4 +107,4 @@ print(machine.succeed("find /tmp/hakurei.0 " + "-path '/tmp/hakurei.0/runtime/*/*' -prune -o " + "-path '/tmp/hakurei.0/tmpdir/*/*' -prune -o " + "-print")) -print(machine.succeed("find /run/user/1000/hakurei")) +print(machine.fail("ls /run/user/1000/hakurei")) |
