feat: migrate theme and font to declarative Nix options
Some checks failed
Check / eval-and-lint (push) Has been cancelled

This commit is contained in:
Bernardo Magri
2026-05-31 19:33:33 +01:00
parent a2649728d3
commit 130ae80f3e
6 changed files with 33 additions and 42 deletions

View File

@@ -42,7 +42,11 @@ in
theme = lib.mkOption {
type = lib.types.str;
default = schema.home.theme;
description = "System theme name.";
description = ''
System theme name. This is the declarative source of truth.
Changing this and running `nomarchy-env-update` (or a system
rebuild) will update the entire desktop.
'';
};
formFactor = lib.mkOption {
type = lib.types.enum [ "laptop" "desktop" ];
@@ -120,7 +124,11 @@ in
monospace = lib.mkOption {
type = lib.types.str;
default = schema.home.font;
description = "System monospace font.";
description = ''
System monospace font. This is the declarative source of truth.
Changing this and running `nomarchy-env-update` (or a system
rebuild) will update the entire desktop.
'';
};
};
iconsTheme = lib.mkOption {

View File

@@ -28,36 +28,18 @@ let
in
{
# Every assignment uses lib.mkDefault so a downstream /etc/nixos/home.nix
# can override the state.json-derived value. Without mkDefault, every
# option here would resolve at default priority and conflict on
# assignment from the user's config.
# can override the value. The Nix options are now the declarative source
# of truth. state.json is purely seeded to keep runtime scripts (menu,
# summary) in sync with the Nix-level state.
config = {
nomarchy = {
toggles = {
suspend = lib.mkDefault (togglesState.suspend or schema.home.suspend);
screensaver = lib.mkDefault (togglesState.screensaver or schema.home.screensaver);
idle = lib.mkDefault (togglesState.idle or schema.home.idle);
nightlight = lib.mkDefault (togglesState.nightlight or schema.home.nightlight);
waybar = lib.mkDefault (togglesState.waybar or schema.home.waybar);
};
nightlightTemperature = lib.mkDefault (togglesState.nightlightTemperature or schema.home.nightlightTemperature);
theme = lib.mkDefault (togglesState.theme or schema.home.theme);
wallpaper = lib.mkDefault (togglesState.wallpaper or schema.home.wallpaper);
panelPosition = lib.mkDefault (togglesState.panelPosition or schema.home.panelPosition);
hyprland = {
gaps_in = lib.mkDefault (togglesState.hyprland.gaps_in or schema.home.hyprland.gaps_in);
gaps_out = lib.mkDefault (togglesState.hyprland.gaps_out or schema.home.hyprland.gaps_out);
border_size = lib.mkDefault (togglesState.hyprland.border_size or schema.home.hyprland.border_size);
};
fonts.monospace = lib.mkDefault (togglesState.font or schema.home.font);
# Derived properties from the theme directory
isLightMode = lib.mkDefault (nomarchyLib.isThemeLightMode {
themeName = togglesState.theme or schema.home.theme;
themeName = cfg.theme;
inherit assetsPath;
});
iconsTheme = lib.mkDefault (nomarchyLib.getIconsTheme {
themeName = togglesState.theme or schema.home.theme;
themeName = cfg.theme;
inherit assetsPath;
});
};