update: fixed issues and update flake inputs

This commit is contained in:
danny 2025-12-29 16:03:31 +08:00
parent 4b6183f0ec
commit b3c5ad2880
80 changed files with 3307 additions and 2059 deletions

59
home/options/hyprlock.nix Normal file
View file

@ -0,0 +1,59 @@
{ config, lib, ... }:
let
inherit (lib)
mkOption
types
isList
elemAt
mapAttrs
hasAttr
any
length
;
cfg = config.programs.hyprlock;
in
{
options.programs.hyprlock = {
monitors = mkOption {
default = [ ];
type = with types; listOf str;
};
excludeMonitor = mkOption {
default = [
"general"
"background"
"animations"
];
type = with types; listOf str;
};
settings = mkOption {
apply =
v:
if length cfg.monitors == 0 then
v
else
mapAttrs (
name: value:
let
mainMonitor = elemAt cfg.monitors 0;
applyMonitor =
attrs:
if hasAttr "monitor" attrs then
attrs
else
(
attrs
// {
monitor = mainMonitor;
}
);
in
if any (m: name == m) cfg.excludeMonitor then
value
else
(if (isList value) then (map applyMonitor value) else applyMonitor value)
) v;
};
};
}