mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 22:11:33 +01:00
Install and configure wluma on fern
This commit is contained in:
parent
e0df2fc5c0
commit
643a05edbd
2 changed files with 49 additions and 0 deletions
48
modules/home/de/wluma.nix
Normal file
48
modules/home/de/wluma.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.de.wluma.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.wluma.enable {
|
||||
home.packages = [ pkgs.wluma ];
|
||||
|
||||
xdg.configFile."wluma/config.toml".source = (pkgs.formats.toml { }).generate "wluma-config" {
|
||||
als.iio = {
|
||||
path = "/sys/bus/iio/devices";
|
||||
thresholds = {
|
||||
"0" = "night";
|
||||
"20" = "dark";
|
||||
"80" = "dim";
|
||||
"250" = "normal";
|
||||
"500" = "bright";
|
||||
"800" = "outdoors";
|
||||
};
|
||||
};
|
||||
output.backlight = [
|
||||
{
|
||||
name = "eDP-1";
|
||||
path = "/sys/class/backlight/amdgpu_bl1";
|
||||
capturer = "wayland";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
systemd.user.services.wluma = {
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
Unit = {
|
||||
Description = "Automatic brightness adjustment based on screen contents and ALS";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
X-Restart-Triggers = [ config.xdg.configFile."wluma/config.toml".source ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = lib.getExe pkgs.wluma;
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue