diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-08 05:03:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-08 05:03:16 +0900 |
| commit | c8eeb4a4d122189dadb093839c5b98188db9be31 (patch) | |
| tree | 52ab58a1cd8faf306c3a13e3c0b54823487391f8 /internal/outcome/sppipewire.go | |
| parent | 5785714b64149c2377cd9697c77162b3e7b37e7d (diff) | |
internal/outcome: integrate pipewire server
This is very simple and takes almost no inputs. This is not yet hooked up to anything to prevent breaking any existing behaviour.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/outcome/sppipewire.go')
| -rw-r--r-- | internal/outcome/sppipewire.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/internal/outcome/sppipewire.go b/internal/outcome/sppipewire.go new file mode 100644 index 00000000..b8c855f6 --- /dev/null +++ b/internal/outcome/sppipewire.go @@ -0,0 +1,31 @@ +package outcome + +import ( + "encoding/gob" + + "hakurei.app/hst" + "hakurei.app/internal/pipewire" +) + +func init() { gob.Register(spPipeWireOp{}) } + +// spPipeWireOp exports the PipeWire server to the container via SecurityContext. +// Runs after spRuntimeOp. +type spPipeWireOp struct{} + +func (s spPipeWireOp) toSystem(state *outcomeStateSys) error { + if state.et&hst.EPipeWire == 0 { + return errNotEnabled + } + + state.sys.PipeWire(state.instance().Append("pipewire")) + return nil +} + +func (s spPipeWireOp) toContainer(state *outcomeStateParams) error { + innerPath := state.runtimeDir.Append(pipewire.PW_DEFAULT_REMOTE) + state.env[pipewire.Remote] = innerPath.String() + state.params.Bind(state.instancePath().Append("pipewire"), innerPath, 0) + + return nil +} |
