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 }