fix(home-manager/hyprland): import accents from file (#347)

Ensure accents are defined before user vars
Partially reverts 512306ae
This commit is contained in:
Weathercold 2024-10-08 12:59:36 -04:00 committed by GitHub
parent bad96d3fab
commit 65f2a8a364
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 6 deletions

View file

@ -18,9 +18,14 @@ in
}; };
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ]; source = [
"$accent" = "\$${cfg.accent}"; "${sources.hyprland}/themes/${cfg.flavor}.conf"
"$accentAlpha" = "\$${cfg.accent}Alpha"; # 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
'')
];
}; };
}; };
} }

View file

@ -11,9 +11,14 @@ in
config = lib.mkIf enable { config = lib.mkIf enable {
programs.hyprlock.settings = { programs.hyprlock.settings = {
source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ]; source = [
"$accent" = "\$${cfg.accent}"; "${sources.hyprland}/themes/${cfg.flavor}.conf"
"$accentAlpha" = "\$${cfg.accent}Alpha"; # 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
'')
];
}; };
}; };
} }