hst/dbus: move dbus config struct
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m11s
Test / Hakurei (push) Successful in 3m12s
Test / Hpkg (push) Successful in 4m0s
Test / Hakurei (race detector) (push) Successful in 5m20s
Test / Sandbox (race detector) (push) Successful in 2m11s
Test / Flake checks (push) Successful in 1m31s

This allows holding a xdg-dbus-proxy configuration without importing system/dbus.

It also makes more sense in the project structure since the config struct is part of the hst API however the rest of the implementation is not.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-10-07 19:01:18 +09:00
parent 3ce63e95d7
commit d23b4dc9e6
17 changed files with 185 additions and 251 deletions

View File

@@ -9,6 +9,7 @@ import (
"hakurei.app/container"
"hakurei.app/helper"
"hakurei.app/hst"
)
// ProxyName is the file name or path to the proxy program.
@@ -66,23 +67,23 @@ type Final struct {
}
// Finalise creates a checked argument writer for [Proxy].
func Finalise(sessionBus, systemBus ProxyPair, session, system *Config) (final *Final, err error) {
func Finalise(sessionBus, systemBus ProxyPair, session, system *hst.BusConfig) (final *Final, err error) {
if session == nil && system == nil {
return nil, syscall.EBADE
}
var args []string
if session != nil {
if err = session.checkInterfaces("session"); err != nil {
if err = checkInterfaces(session, "session"); err != nil {
return
}
args = append(args, session.Args(sessionBus)...)
args = append(args, Args(session, sessionBus)...)
}
if system != nil {
if err = system.checkInterfaces("system"); err != nil {
if err = checkInterfaces(system, "system"); err != nil {
return
}
args = append(args, system.Args(systemBus)...)
args = append(args, Args(system, systemBus)...)
}
final = &Final{Session: sessionBus, System: systemBus}