diff --git a/home/david/configurations/Akun/niri.nix b/home/david/configurations/Akun/niri.nix index ccd2a2d..74ea5b8 100644 --- a/home/david/configurations/Akun/niri.nix +++ b/home/david/configurations/Akun/niri.nix @@ -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 [ diff --git a/home/david/configurations/Tytonidae/niri.nix b/home/david/configurations/Tytonidae/niri.nix index 1097e49..a698d1a 100644 --- a/home/david/configurations/Tytonidae/niri.nix +++ b/home/david/configurations/Tytonidae/niri.nix @@ -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 [ diff --git a/home/david/modules/programs/default.nix b/home/david/modules/programs/default.nix index 372ba12..6fd6896 100644 --- a/home/david/modules/programs/default.nix +++ b/home/david/modules/programs/default.nix @@ -2,7 +2,7 @@ imports = [ ./openssh.nix ./niri - ./wluma + ./wluma.nix ./helix.nix ./firefox.nix ./waybar.nix diff --git a/home/david/modules/programs/niri/default.nix b/home/david/modules/programs/niri/default.nix index e48aa14..dae9b6a 100644 --- a/home/david/modules/programs/niri/default.nix +++ b/home/david/modules/programs/niri/default.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; diff --git a/home/david/modules/programs/wluma.nix b/home/david/modules/programs/wluma.nix new file mode 100644 index 0000000..667d4d0 --- /dev/null +++ b/home/david/modules/programs/wluma.nix @@ -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; + }; + }; + }; +} diff --git a/home/david/modules/programs/wluma/config.toml b/home/david/modules/programs/wluma/config.toml deleted file mode 100644 index 8ae2f7d..0000000 --- a/home/david/modules/programs/wluma/config.toml +++ /dev/null @@ -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" diff --git a/home/david/modules/programs/wluma/default.nix b/home/david/modules/programs/wluma/default.nix deleted file mode 100644 index 960fafa..0000000 --- a/home/david/modules/programs/wluma/default.nix +++ /dev/null @@ -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; - }; - }; - }; -}