From 65f2a8a36422e54ae469f3fc6325775ce497724b Mon Sep 17 00:00:00 2001 From: Weathercold Date: Tue, 8 Oct 2024 12:59:36 -0400 Subject: [PATCH] fix(home-manager/hyprland): import accents from file (#347) Ensure accents are defined before user vars Partially reverts 512306ae --- modules/home-manager/hyprland.nix | 11 ++++++++--- modules/home-manager/hyprlock.nix | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 6d94fce5..fb3351f7 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -18,9 +18,14 @@ in }; wayland.windowManager.hyprland.settings = { - source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ]; - "$accent" = "\$${cfg.accent}"; - "$accentAlpha" = "\$${cfg.accent}Alpha"; + source = [ + "${sources.hyprland}/themes/${cfg.flavor}.conf" + # Define accents in file to ensure they appear before user vars + (builtins.toFile "hyprland-${cfg.accent}-accent.conf" '' + $accent = ''$${cfg.accent} + $accentAlpha = ''$${cfg.accent}Alpha + '') + ]; }; }; } diff --git a/modules/home-manager/hyprlock.nix b/modules/home-manager/hyprlock.nix index dcf42d0e..37ca432f 100644 --- a/modules/home-manager/hyprlock.nix +++ b/modules/home-manager/hyprlock.nix @@ -11,9 +11,14 @@ in config = lib.mkIf enable { programs.hyprlock.settings = { - source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ]; - "$accent" = "\$${cfg.accent}"; - "$accentAlpha" = "\$${cfg.accent}Alpha"; + source = [ + "${sources.hyprland}/themes/${cfg.flavor}.conf" + # Define accents in file to ensure they appear before user vars + (builtins.toFile "hyprland-${cfg.accent}-accent.conf" '' + $accent = ''$${cfg.accent} + $accentAlpha = ''$${cfg.accent}Alpha + '') + ]; }; }; }