fix(core): handle null omnixy.preset everywhere it's interpolated

Same null-vs-missing bug as the fastfetch fix, across lib.nix (env var +
status echo), menus.nix, scripts.nix, and fastfetch's about screen:
`cfg.preset or "…"` returns null (not the fallback) because preset
defaults to null. Any consumer that doesn't set a preset hit 'cannot
coerce null to a string'. Replace with explicit null checks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-06-28 10:45:21 +02:00
commit 8011163293
4 changed files with 5 additions and 5 deletions

View file

@ -148,7 +148,7 @@ in
environment.variables = {
OMNI_USER = cfg.user;
OMNI_THEME = cfg.theme;
OMNI_PRESET = cfg.preset or "custom";
OMNI_PRESET = if cfg.preset == null then "custom" else cfg.preset;
OMNI_CONFIG_DIR = helpers.paths.config;
OMNI_CACHE_DIR = helpers.paths.cache;
};
@ -174,7 +174,7 @@ in
echo "Configuration:"
echo " User: ${cfg.user}"
echo " Theme: ${cfg.theme}"
echo " Preset: ${cfg.preset or "none"}"
echo " Preset: ${if cfg.preset == null then "none" else cfg.preset}"
echo ""
echo "Colors (base16 scheme):"
echo " Background: ${helpers.colors.bg}"