aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-08 02:37:13 +0900
committerOphestra <cat@gensokyo.uk>2025-12-08 02:39:55 +0900
commit104eeecf650ba52e155ff63a4d4456a6391e961f (patch)
tree9aaee654702dd22812dee4783f200e5e1552ccb4
parentbf856f06e5dc864a1e3714fc8f1fd15ddb433ee7 (diff)
cmd/hakurei: add pipewire flag
This is for "run" command, formerly permissive defaults behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--cmd/hakurei/command.go9
-rw-r--r--cmd/hakurei/command_test.go6
-rw-r--r--dist/comp/_hakurei3
3 files changed, 13 insertions, 5 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go
index 5d33d41b..63467e5f 100644
--- a/cmd/hakurei/command.go
+++ b/cmd/hakurei/command.go
@@ -91,7 +91,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
flagPrivateRuntime, flagPrivateTmpdir bool
- flagWayland, flagX11, flagDBus, flagPulse bool
+ flagWayland, flagX11, flagDBus, flagPipeWire, flagPulse bool
)
c.NewCommand("run", "Configure and start a permissive container", func(args []string) error {
@@ -146,6 +146,9 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
if flagDBus {
et |= hst.EDBus
}
+ if flagPipeWire || flagPulse {
+ et |= hst.EPipeWire
+ }
if flagPulse {
et |= hst.EPulse
}
@@ -297,8 +300,10 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr
"Enable direct connection to X11").
Flag(&flagDBus, "dbus", command.BoolFlag(false),
"Enable proxied connection to D-Bus").
+ Flag(&flagPipeWire, "pipewire", command.BoolFlag(false),
+ "Enable connection to PipeWire via SecurityContext").
Flag(&flagPulse, "pulse", command.BoolFlag(false),
- "Enable direct connection to PulseAudio")
+ "Enable PulseAudio compatibility daemon")
}
{
diff --git a/cmd/hakurei/command_test.go b/cmd/hakurei/command_test.go
index 82e67f23..4edf4a0b 100644
--- a/cmd/hakurei/command_test.go
+++ b/cmd/hakurei/command_test.go
@@ -36,7 +36,7 @@ Commands:
},
{
"run", []string{"run", "-h"}, `
-Usage: hakurei run [-h | --help] [--dbus-config <value>] [--dbus-system <value>] [--mpris] [--dbus-log] [--id <value>] [-a <int>] [-g <value>] [-d <value>] [-u <value>] [--private-runtime] [--private-tmpdir] [--wayland] [-X] [--dbus] [--pulse] COMMAND [OPTIONS]
+Usage: hakurei run [-h | --help] [--dbus-config <value>] [--dbus-system <value>] [--mpris] [--dbus-log] [--id <value>] [-a <int>] [-g <value>] [-d <value>] [-u <value>] [--private-runtime] [--private-tmpdir] [--wayland] [-X] [--dbus] [--pipewire] [--pulse] COMMAND [OPTIONS]
Flags:
-X Enable direct connection to X11
@@ -58,12 +58,14 @@ Flags:
Reverse-DNS style Application identifier, leave empty to inherit instance identifier
-mpris
Allow owning MPRIS D-Bus path, has no effect if custom config is available
+ -pipewire
+ Enable connection to PipeWire via SecurityContext
-private-runtime
Do not share XDG_RUNTIME_DIR between containers under the same identity
-private-tmpdir
Do not share TMPDIR between containers under the same identity
-pulse
- Enable direct connection to PulseAudio
+ Enable PulseAudio compatibility daemon
-u string
Passwd user name within sandbox (default "chronos")
-wayland
diff --git a/dist/comp/_hakurei b/dist/comp/_hakurei
index d1c7d4f2..8230ba4c 100644
--- a/dist/comp/_hakurei
+++ b/dist/comp/_hakurei
@@ -17,7 +17,8 @@ _hakurei_run() {
'--wayland[Enable connection to Wayland via security-context-v1]' \
'-X[Enable direct connection to X11]' \
'--dbus[Enable proxied connection to D-Bus]' \
- '--pulse[Enable direct connection to PulseAudio]' \
+ '--pipewire[Enable connection to PipeWire via SecurityContext]' \
+ '--pulse[Enable PulseAudio compatibility daemon]' \
'--dbus-config[Path to session bus proxy config file]: :_files -g "*.json"' \
'--dbus-system[Path to system bus proxy config file]: :_files -g "*.json"' \
'--mpris[Allow owning MPRIS D-Bus path]' \