nixos/openrazer: add additional battery notifier options (#273761)
This commit is contained in:
@@ -19,7 +19,9 @@ let
|
|||||||
[Startup]
|
[Startup]
|
||||||
sync_effects_enabled = ${toPyBoolStr cfg.syncEffectsEnabled}
|
sync_effects_enabled = ${toPyBoolStr cfg.syncEffectsEnabled}
|
||||||
devices_off_on_screensaver = ${toPyBoolStr cfg.devicesOffOnScreensaver}
|
devices_off_on_screensaver = ${toPyBoolStr cfg.devicesOffOnScreensaver}
|
||||||
mouse_battery_notifier = ${toPyBoolStr cfg.mouseBatteryNotifier}
|
battery_notifier = ${toPyBoolStr (cfg.mouseBatteryNotifier || cfg.batteryNotifier.enable)}
|
||||||
|
battery_notifier_freq = ${builtins.toString cfg.batteryNotifier.frequency}
|
||||||
|
battery_notifier_percent = ${builtins.toString cfg.batteryNotifier.percentage}
|
||||||
|
|
||||||
[Statistics]
|
[Statistics]
|
||||||
key_statistics = ${toPyBoolStr cfg.keyStatistics}
|
key_statistics = ${toPyBoolStr cfg.keyStatistics}
|
||||||
@@ -86,6 +88,41 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
batteryNotifier = mkOption {
|
||||||
|
description = ''
|
||||||
|
Settings for device battery notifications.
|
||||||
|
'';
|
||||||
|
default = {};
|
||||||
|
type = types.submodule {
|
||||||
|
options = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Mouse battery notifier.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
frequency = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 600;
|
||||||
|
description = ''
|
||||||
|
How often battery notifications should be shown (in seconds).
|
||||||
|
A value of 0 disables notifications.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
percentage = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 33;
|
||||||
|
description = ''
|
||||||
|
At what battery percentage the device should reach before
|
||||||
|
sending notifications.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
keyStatistics = mkOption {
|
keyStatistics = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@@ -107,6 +144,13 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
warnings = flatten [
|
||||||
|
(optional cfg.mouseBatteryNotifier ''
|
||||||
|
The option openrazer.mouseBatteryNotifier is deprecated.
|
||||||
|
Please use openrazer.batteryNotifier instead to enable and configure battery notifications.
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
boot.extraModulePackages = [ kernelPackages.openrazer ];
|
boot.extraModulePackages = [ kernelPackages.openrazer ];
|
||||||
boot.kernelModules = drivers;
|
boot.kernelModules = drivers;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user