Files
Nomarchy/themes/engine/stylix.nix
Bernardo Magri 877da19770 feat: make VM and live ISO match an installed Nomarchy
- Migrate VM and graphical ISO to home-manager.nixosModules.home-manager;
  drop the standalone-HM sudo-based activation script (ran HM against
  /root because HOME wasn't reset) in flake.nix, core/system/vm-guest.nix,
  hosts/live-iso.nix.
- Run swaybg as nomarchy-wallpaper.service instead of a silent Hyprland
  exec-once so failures surface in systemctl.
- Skip the battery monitor unit on hosts without /sys/class/power_supply/BAT*
  (VMs, desktops).
- Don't wrap walker --dmenu in uwsm-app; redirect setsid background std-fds
  in nomarchy-launch-walker so $(menu ...) in nomarchy-menu doesn't hang.
- Restart waybar/walker via systemctl --user rather than pkill + uwsm-app
  to stop the post-theme-switch color race.
- Wire nomarchy-restart-walker/-waybar into nomarchy-theme-set so themes
  that only change the imported CSS reload correctly.
- Waybar: pin #custom-nomarchy to the Nomarchy font and use the U+F000
  codepoint so the logo shows across all themes.
- Auto-install the correct icon-theme package per palette via a new
  nomarchyLib.iconThemePackage helper in lib/default.nix; Everforest now
  actually renders for summer-night.
- Pre-cache every theme's HM generation: new packages.allThemeVariants
  flake output and nomarchy-themes-prebuild script so theme switches are
  cache-only (no Stylix rebuild, no downloads).
- Add nomarchy-test-live-iso to boot the graphical ISO in QEMU the same
  way nomarchy-test-vm does, with virtio-gpu support added to live-iso.nix.
- Installer-generated home.nix/system.nix now ship a curated, commented
  app menu (btop/fastfetch/chromium on by default) plus optional system
  services (Docker, libvirtd, Tailscale, Syncthing, Flatpak, Steam).
- nomarchy-test-vm now wipes the stale nomarchy.qcow2 before launch.
- Remove obsolete GEMINI.md and PLAN.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 18:20:54 +01:00

110 lines
3.3 KiB
Nix

{ config, pkgs, inputs, lib, ... }:
# Stylix Integration Module
#
# This module handles base-level theming through Stylix:
# - Color scheme injection from the active theme's palette
# - Cursor configuration
# - Font configuration
# - GTK/GNOME theming
#
# App-specific theming is handled separately:
# - theme-loader.nix: Deploys theme's apps/ configs (btop, neovim, etc.)
# - waybar.nix: Generates waybar CSS from colorScheme
# - hyprland.nix: Handles hyprland border colors
#
# Stylix targets disabled here (we have custom implementations):
# - hyprland: Custom border/rule config
# - waybar: Custom CSS with theme colors
let
nomarchyLib = import ../../lib { inherit lib; };
assetsPath = ../palettes;
activeThemeName = config.nomarchy.theme;
# Use shared wallpaper resolver
activeWallpaper = nomarchyLib.resolveWallpaper {
wallpaperPath = config.nomarchy.wallpaper;
themeName = activeThemeName;
inherit assetsPath;
};
# Get palette using shared library
currentPalette = nomarchyLib.getPalette activeThemeName;
in
{
imports = [ inputs.stylix.homeModules.stylix ];
xdg.configFile."nomarchy/current/background".source = activeWallpaper;
stylix = {
enable = lib.mkDefault true;
enableReleaseChecks = lib.mkDefault false;
autoEnable = lib.mkDefault false; # Disable auto-detection, explicitly enable targets
image = lib.mkDefault activeWallpaper;
base16Scheme = lib.mkDefault currentPalette;
# Use detected light mode state
polarity = lib.mkDefault (if config.nomarchy.isLightMode then "light" else "dark");
cursor = lib.mkDefault {
package = config.nomarchy.cursor.package;
name = config.nomarchy.cursor.name;
size = 24;
};
fonts = lib.mkDefault {
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = config.nomarchy.fonts.monospace;
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
serif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Serif";
};
emoji = {
package = pkgs.noto-fonts-color-emoji;
name = "Noto Color Emoji";
};
sizes = {
applications = 11;
terminal = 11;
desktop = 11;
popups = 11;
};
};
# Enable theming for specific targets
targets = lib.mkDefault {
hyprland.enable = false; # We keep our custom hyprland config for borders/rules
waybar.enable = false; # We keep our custom waybar CSS
neovim.enable = false; # We deploy theme lua files via theme-loader instead
neovide.enable = false; # Neovide depends on neovim program module
alacritty.enable = true;
kitty.enable = true;
gtk.enable = true;
gnome.enable = true;
};
};
# GTK Icon Theme configuration. The package is derived from the theme's
# declared icon family (palettes/<theme>/icons.theme), so switching to a
# palette that needs e.g. Everforest icons automatically installs
# `everforest-gtk-variant` instead of sticking with `yaru-theme`.
gtk = {
enable = lib.mkDefault true;
iconTheme = lib.mkDefault {
package = nomarchyLib.iconThemePackage {
iconsTheme = config.nomarchy.iconsTheme;
inherit pkgs;
};
name = config.nomarchy.iconsTheme;
};
};
}