hyprlock: remove with lib;

This commit is contained in:
Austin Horstman
2025-01-14 13:39:00 -06:00
parent a1f180af17
commit 0dfec9deb2

View File

@@ -1,16 +1,14 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.programs.hyprlock;
in {
meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ];
meta.maintainers = with lib.maintainers; [ khaneliman fufexan ];
options.programs.hyprlock = {
enable = mkEnableOption "" // {
enable = lib.mkEnableOption "" // {
description = ''
Whether to enable Hyprlock, Hyprland's GPU-accelerated lock screen
utility.
@@ -27,7 +25,7 @@ in {
'';
};
package = mkPackageOption pkgs "hyprlock" { };
package = lib.mkPackageOption pkgs "hyprlock" { };
settings = lib.mkOption {
type = with lib.types;
@@ -111,12 +109,12 @@ in {
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."hypr/hyprlock.conf" =
let shouldGenerate = cfg.extraConfig != "" || cfg.settings != { };
in mkIf shouldGenerate {
in lib.mkIf shouldGenerate {
text = lib.optionalString (cfg.settings != { })
(lib.hm.generators.toHyprconf {
attrs = cfg.settings;