Improve deUtils dependency management

This commit is contained in:
SebastianStork 2025-03-26 17:54:26 +01:00
parent 206c43f71a
commit 1f8cadb2dc
6 changed files with 32 additions and 9 deletions

View file

@ -0,0 +1,13 @@
{
config,
pkgs,
lib,
...
}:
{
options.myConfig.deUtils.brightnessctl.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.deUtils.brightnessctl.enable {
home.packages = [ pkgs.brightnessctl ];
};
}

View file

@ -8,6 +8,13 @@
options.myConfig.deUtils.cliphist.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.deUtils.cliphist.enable {
assertions = [
{
assertion = config.myConfig.deUtils.rofi.enable;
message = "cliphist requires rofi";
}
];
services.cliphist = {
enable = true;
allowImages = false;

View file

@ -17,17 +17,17 @@
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
lock_cmd = lib.mkIf config.myConfig.deUtils.hyprlock.enable "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
(lib.mkIf config.myConfig.deUtils.brightnessctl.enable {
timeout = 5 * 60;
on-timeout = "brightnessctl --save --exponent set 10%";
on-resume = "brightnessctl --restore";
}
})
{
timeout = 10 * 60;
on-timeout = "hyprctl dispatch dpms off";