module(wluma): Refactor wluma module
This commit is contained in:
parent
34b35719e8
commit
deac0d0d8f
7 changed files with 98 additions and 49 deletions
|
|
@ -2,6 +2,17 @@
|
|||
inherit (inputs.niri-flake.lib.kdl) node leaf flag;
|
||||
in {
|
||||
david.programs.niri = {
|
||||
wluma.extraSettings = {
|
||||
output = {
|
||||
backlight = [
|
||||
{
|
||||
name = "eDP-1";
|
||||
path = "/sys/class/backlight/intel_backlight";
|
||||
capturer = "wayland";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
extraConfig = let
|
||||
output = node "output";
|
||||
in [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,28 @@
|
|||
inherit (inputs.niri-flake.lib.kdl) node leaf flag;
|
||||
in {
|
||||
david.programs.niri = {
|
||||
wluma.extraSettings = {
|
||||
output = {
|
||||
backlight = [
|
||||
{
|
||||
name = "eDP-1";
|
||||
path = "/sys/class/backlight/nvidia_0";
|
||||
capturer = "wayland";
|
||||
}
|
||||
{
|
||||
name = "DP-3";
|
||||
path = "/sys/class/backlight/ddcci13";
|
||||
capturer = "wayland";
|
||||
}
|
||||
];
|
||||
};
|
||||
keyboard = [
|
||||
{
|
||||
name = "keyboard-asus";
|
||||
path = "/sys/bus/platform/devices/asus-nb-wmi/leds/asus::kbd_backlight";
|
||||
}
|
||||
];
|
||||
};
|
||||
extraConfig = let
|
||||
output = node "output";
|
||||
in [
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
imports = [
|
||||
./openssh.nix
|
||||
./niri
|
||||
./wluma
|
||||
./wluma.nix
|
||||
./helix.nix
|
||||
./firefox.nix
|
||||
./waybar.nix
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
inputs,
|
||||
pkgs,
|
||||
osConfig ? null,
|
||||
options,
|
||||
...
|
||||
} @ args: let
|
||||
cfg = config.david.programs.niri;
|
||||
|
|
@ -15,6 +16,9 @@ in {
|
|||
extraConfig = lib.mkOption {
|
||||
type = inputs.niri-flake.lib.kdl.types.kdl-document;
|
||||
};
|
||||
wluma.extraSettings = lib.mkOption {
|
||||
inherit (options.david.programs.wluma.extraSettings) type;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
|
|
@ -62,7 +66,10 @@ in {
|
|||
david.programs = {
|
||||
fuzzel.enable = true;
|
||||
waybar.enable = true;
|
||||
wluma.enable = true;
|
||||
wluma = {
|
||||
enable = true;
|
||||
inherit (cfg.wluma) extraSettings;
|
||||
};
|
||||
swaync.enable = true;
|
||||
swaylock.enable = true;
|
||||
waypaper.enable = true;
|
||||
|
|
|
|||
56
home/david/modules/programs/wluma.nix
Normal file
56
home/david/modules/programs/wluma.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
cfg = config.david.programs.wluma;
|
||||
in {
|
||||
options = {
|
||||
david.programs.wluma = {
|
||||
enable = lib.mkEnableOption "wluma";
|
||||
extraSettings = lib.mkOption {
|
||||
inherit (options.services.wluma.settings) type;
|
||||
example = ''
|
||||
output = {
|
||||
backlight = [
|
||||
{
|
||||
name = "eDP-1";
|
||||
path = "/sys/class/backlight/nvidia_0";
|
||||
capturer = "wayland";
|
||||
}
|
||||
{
|
||||
name = "DP-1";
|
||||
path = "/sys/class/backlight/ddcci13";
|
||||
capturer = "wayland";
|
||||
}
|
||||
];
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.wluma = {
|
||||
enable = true;
|
||||
settings = {
|
||||
als = {
|
||||
webcam = {
|
||||
video = 0;
|
||||
thresholds = {
|
||||
"0" = "night";
|
||||
"15" = "dark";
|
||||
"30" = "dim";
|
||||
"45" = "normal";
|
||||
"60" = "bright";
|
||||
"75" = "outdoors";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
# [als.iio]
|
||||
# path = "/sys/bus/iio/devices"
|
||||
# thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" }
|
||||
|
||||
[als.webcam]
|
||||
video = 0
|
||||
thresholds = { 0 = "night", 15 = "dark", 30 = "dim", 45 = "normal", 60 = "bright", 75 = "outdoors" }
|
||||
|
||||
# [als.time]
|
||||
# thresholds = { 0 = "night", 7 = "dark", 9 = "dim", 11 = "normal", 13 = "bright", 16 = "normal", 18 = "dark", 20 = "night" }
|
||||
|
||||
# [als.none]
|
||||
|
||||
[[output.backlight]]
|
||||
name = "eDP-1"
|
||||
path = "/sys/class/backlight/intel_backlight"
|
||||
capturer = "wayland"
|
||||
|
||||
# [[output.ddcutil]]
|
||||
# name = "Dell Inc. DELL P2415Q"
|
||||
# capturer = "none"
|
||||
|
||||
[[keyboard]]
|
||||
name = "keyboard-asus"
|
||||
path = "/sys/bus/platform/devices/asus-nb-wmi/leds/asus::kbd_backlight"
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.david.programs.wluma;
|
||||
in {
|
||||
options = {
|
||||
david.programs.wluma = {
|
||||
enable = lib.mkEnableOption "wluma";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.wluma = {
|
||||
enable = true;
|
||||
settings = ./config.toml |> builtins.readFile |> builtins.fromTOML;
|
||||
systemd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue