aboutsummaryrefslogtreecommitdiffhomepage
path: root/nixos.nix
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 /nixos.nix
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 'nixos.nix')
-rw-r--r--nixos.nix9
1 files changed, 4 insertions, 5 deletions
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"}