feat(niri,xbacklight): Brightness control

This commit is contained in:
2025-08-08 20:52:23 -06:00
parent 73c894f7c0
commit 5bc81f909e
5 changed files with 54 additions and 79 deletions

View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
let cfg = config.sydnix.xbacklight-permissions;
in {
options.sydnix.xbacklight-permissions = {
enable =
lib.mkEnableOption "the user group that is allowed to use xbacklight";
group = lib.mkOption {
type = lib.types.str;
default = "xbacklight";
};
paths = lib.mkOption {
type = with lib.types; listOf str;
default = [
"/sys/class/backlight/intel_backlight/brightness"
];
};
};
config = lib.mkIf cfg.enable {
users.groups.${cfg.group} = {};
systemd.tmpfiles.settings."50-xbacklight" =
lib.mergeAttrsList
(builtins.map
(path: {
${path}.z = {
inherit (cfg) group;
mode = "0664";
user = "root";
};
})
cfg.paths);
};
}