From 4ffeec3004607b76f73e504da220a1490c598348 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 15 Aug 2025 04:57:37 +0900 Subject: 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 --- nixos.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nixos.nix') diff --git a/nixos.nix b/nixos.nix index 5d051438..4f083bcb 100644 --- a/nixos.nix +++ b/nixos.nix @@ -102,8 +102,7 @@ in }; command = if app.command == null then app.name else app.command; script = if app.script == null then ("exec " + command + " $@") else app.script; - enablements = with app.capability; (if wayland then 1 else 0) + (if x11 then 2 else 0) + (if dbus then 4 else 0) + (if pulse then 8 else 0); - isGraphical = if app.gpu != null then app.gpu else app.capability.wayland || app.capability.x11; + isGraphical = if app.gpu != null then app.gpu else app.enablements.wayland || app.enablements.x11; conf = { path = @@ -116,7 +115,7 @@ in app.path; args = if app.args == null then [ "${app.name}-start" ] else app.args; - inherit id enablements; + inherit id; inherit (dbusConfig) session_bus system_bus; direct_wayland = app.insecureWayland; @@ -125,7 +124,7 @@ in data = getsubhome fid app.identity; inherit (cfg) shell; - inherit (app) identity groups; + inherit (app) identity groups enablements; container = { inherit (app) @@ -226,7 +225,7 @@ in pkg = if app.share != null then app.share else pkgs.${app.name}; copy = source: "[ -d '${source}' ] && cp -Lrv '${source}' $out/share || true"; in - optional (app.capability.wayland || app.capability.x11) ( + optional (app.enablements.wayland || app.enablements.x11) ( pkgs.runCommand "${app.name}-share" { } '' mkdir -p $out/share ${copy "${pkg}/share/applications"} -- cgit v1.3.1