aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/hpkg
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-15 04:57:37 +0900
committerOphestra <cat@gensokyo.uk>2025-08-15 05:16:51 +0900
commit4ffeec3004607b76f73e504da220a1490c598348 (patch)
tree68cca16c22814b13974db0f19c151f8eb31e2dae /cmd/hpkg
parent9ed3ba85eaba4bc4bd12b290dc4daf00ffe159dc (diff)
hst/enablement: editor friendly enablement adaptor
Having the bit field value here (in decimal, no less) is unfriendly to text editors. Use a bunch of booleans here to improve ease of use. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/hpkg')
-rw-r--r--cmd/hpkg/app.go3
-rw-r--r--cmd/hpkg/build.nix7
-rw-r--r--cmd/hpkg/test/test.py2
3 files changed, 8 insertions, 4 deletions
diff --git a/cmd/hpkg/app.go b/cmd/hpkg/app.go
index 131f839d..4493dad7 100644
--- a/cmd/hpkg/app.go
+++ b/cmd/hpkg/app.go
@@ -8,7 +8,6 @@ import (
"hakurei.app/container"
"hakurei.app/container/seccomp"
"hakurei.app/hst"
- "hakurei.app/system"
"hakurei.app/system/dbus"
)
@@ -41,7 +40,7 @@ type appInfo struct {
// passed through to [hst.Config]
SessionBus *dbus.Config `json:"session_bus,omitempty"`
// passed through to [hst.Config]
- Enablements system.Enablement `json:"enablements"`
+ Enablements *hst.Enablements `json:"enablements,omitempty"`
// passed through to [hst.Config]
Multiarch bool `json:"multiarch,omitempty"`
diff --git a/cmd/hpkg/build.nix b/cmd/hpkg/build.nix
index 13f3144f..3733f420 100644
--- a/cmd/hpkg/build.nix
+++ b/cmd/hpkg/build.nix
@@ -171,7 +171,12 @@ let
broadcast = { };
});
- enablements = (if allow_wayland then 1 else 0) + (if allow_x11 then 2 else 0) + (if allow_dbus then 4 else 0) + (if allow_pulse then 8 else 0);
+ enablements = {
+ wayland = allow_wayland;
+ x11 = allow_x11;
+ dbus = allow_dbus;
+ pulse = allow_pulse;
+ };
mesa = if gpu then mesaWrappers else null;
nix_gl = if gpu then nixGL else null;
diff --git a/cmd/hpkg/test/test.py b/cmd/hpkg/test/test.py
index c9944354..5a199acc 100644
--- a/cmd/hpkg/test/test.py
+++ b/cmd/hpkg/test/test.py
@@ -92,7 +92,7 @@ wait_for_window("hakurei@machine-foot")
machine.send_chars("clear; wayland-info && touch /tmp/success-client\n")
machine.wait_for_file("/tmp/hakurei.1000/tmpdir/2/success-client")
collect_state_ui("app_wayland")
-check_state("foot", 13)
+check_state("foot", {"wayland": True, "dbus": True, "pulse": True})
# Verify acl on XDG_RUNTIME_DIR:
print(machine.succeed("getfacl --absolute-names --omit-header --numeric /run/user/1000 | grep 1000002"))
machine.send_chars("exit\n")