Skip to content

Commit

Permalink
fix(powerdevil): make assertion more robust against typechecking
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rodrigues <[email protected]>
  • Loading branch information
SigmaSquadron committed Oct 19, 2024
1 parent 374a268 commit 6602d8c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/powerdevil.nix
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,13 @@ in
}
{
assertion =
cfg.powerdevil.${type}.dimDisplay.enable || cfg.powerdevil.${type}.dimDisplay.idleTimeout == null;
(
if builtins.isBool cfg.powerdevil.${type}.dimDisplay.enable then
cfg.powerdevil.${type}.dimDisplay.enable
else
false
)
|| cfg.powerdevil.${type}.dimDisplay.idleTimeout == null;
message = "Cannot set programs.plasma.powerdevil.${type}.dimDisplay.idleTimeout when programs.plasma.powerdevil.${type}.dimDisplay.enable is disabled.";
}
];
Expand Down

0 comments on commit 6602d8c

Please sign in to comment.