extract stylix to separate module, add nixos module with auto-import
This commit is contained in:
parent
35f880b563
commit
7eaa50327f
5 changed files with 90 additions and 49 deletions
|
|
@ -7,40 +7,6 @@ self:
|
|||
}:
|
||||
let
|
||||
cfg = config.programs.nova-shell;
|
||||
|
||||
stylixAvailable = config ? lib && config.lib ? stylix;
|
||||
|
||||
stylixTheme =
|
||||
let
|
||||
c = config.lib.stylix.colors.withHashtag;
|
||||
f = config.stylix.fonts;
|
||||
in
|
||||
{
|
||||
colors = {
|
||||
inherit (c)
|
||||
base00
|
||||
base01
|
||||
base02
|
||||
base03
|
||||
base04
|
||||
base05
|
||||
base06
|
||||
base07
|
||||
base08
|
||||
base09
|
||||
base0A
|
||||
base0B
|
||||
base0C
|
||||
base0D
|
||||
base0E
|
||||
base0F
|
||||
;
|
||||
};
|
||||
fontFamily = f.sansSerif.name;
|
||||
fontSize = f.sizes.desktop;
|
||||
barOpacity = 1.0 - config.stylix.opacity.desktop;
|
||||
iconFontFamily = "Symbols Nerd Font";
|
||||
};
|
||||
in
|
||||
{
|
||||
options.programs.nova-shell = {
|
||||
|
|
@ -295,7 +261,7 @@ in
|
|||
Keys: colors (base00-base0F), fontFamily, iconFontFamily, fontSize,
|
||||
barOpacity, barHeight, barPadding, groupSpacing, groupPadding, moduleSpacing,
|
||||
radius, screenRadius, reducedMotion.
|
||||
Automatically populated from stylix when it is available.
|
||||
Populated from stylix when homeModules.stylix is imported.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -327,11 +293,8 @@ in
|
|||
cfg.modules;
|
||||
|
||||
xdg.configFile."nova-shell/theme.json".source =
|
||||
let
|
||||
stylixDefaults = if stylixAvailable then stylixTheme else { };
|
||||
finalTheme = lib.recursiveUpdate stylixDefaults cfg.theme;
|
||||
in
|
||||
(pkgs.formats.json { }).generate "nova-shell-theme.json" finalTheme;
|
||||
(pkgs.formats.json { }).generate "nova-shell-theme.json"
|
||||
cfg.theme;
|
||||
|
||||
# Niri layer rules for backdrop placement (requires niri-flake hm module)
|
||||
programs.niri.settings.layer-rules = lib.mkIf (config ? programs && config.programs ? niri) [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue