From 4a6e24960a3600b7ab79f304d86827e7ea59b69b Mon Sep 17 00:00:00 2001 From: willow <42willow@pm.me> Date: Wed, 4 Sep 2024 21:35:29 +1000 Subject: [PATCH] feat(home-manager): add support for hyprlock --- .sources/sources.json | 2 +- modules/home-manager/all-modules.nix | 1 + modules/home-manager/hyprlock.nix | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 modules/home-manager/hyprlock.nix diff --git a/.sources/sources.json b/.sources/sources.json index 04ecf5dc..c8a5634f 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -482,4 +482,4 @@ } }, "version": 3 -} \ No newline at end of file +} diff --git a/modules/home-manager/all-modules.nix b/modules/home-manager/all-modules.nix index 0d30f02b..5328e876 100644 --- a/modules/home-manager/all-modules.nix +++ b/modules/home-manager/all-modules.nix @@ -19,6 +19,7 @@ ./gtk.nix ./helix.nix ./hyprland.nix + ./hyprlock.nix ./imv.nix ./k9s.nix ./kitty.nix diff --git a/modules/home-manager/hyprlock.nix b/modules/home-manager/hyprlock.nix new file mode 100644 index 00000000..bf6506bd --- /dev/null +++ b/modules/home-manager/hyprlock.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: +let + inherit (config.catppuccin) sources; + cfg = config.programs.hyprlock.catppuccin; + enable = cfg.enable && config.programs.hyprlock.enable; +in +{ + options.programs.hyprlock.catppuccin = + lib.ctp.mkCatppuccinOpt { name = "hyprlock"; } + // { + accent = lib.ctp.mkAccentOpt "hyprlock"; + }; + + config = lib.mkIf enable { + programs.hyprlock.settings = { + source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ]; + "$accent" = "\$${cfg.accent}"; + "$accentAlpha" = "\$${cfg.accent}Alpha"; + }; + }; +}