Full replacement of the previous iteration, rebuilt around three ideas:
- Pure evaluation: theme-state.json lives inside the flake and is read
via the nomarchy.stateFile option — no --impure, ever.
- All-Home-Manager theming: `nomarchy-theme-sync apply` writes the JSON
and runs `home-manager switch`; every theme change is one atomic,
rollbackable generation. Wallpaper (swww) is the sole runtime piece.
- Flat, downstream-first layout: modules/{nixos,home} with one
options.nix each, exported as nixosModules/homeModules + overlay +
flake template; system (nixos-rebuild) and desktop (home-manager
switch) rebuild paths are fully split.
Ships 21 themes imported from the previous iteration (palettes,
wallpapers, btop themes, six whole-swap Waybar identities), Stylix for
the GTK/Qt/cursor long tail, a live ISO target with offline theme
switching, and docs/TESTING.md with the QEMU verification workflow.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
62 lines
1.6 KiB
Nix
62 lines
1.6 KiB
Nix
# btop — themed from per-theme assets, baked at eval time.
|
|
# A hand-made themes/<slug>/btop.theme asset wins; otherwise a theme is
|
|
# generated from the palette, so custom themes get a themed btop too.
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
t = config.nomarchy.theme;
|
|
c = t.colors;
|
|
|
|
asset = config.nomarchy.themesDir + "/${t.slug}/btop.theme";
|
|
|
|
generated =
|
|
let
|
|
pairs = {
|
|
main_bg = c.base;
|
|
main_fg = c.text;
|
|
title = c.text;
|
|
hi_fg = c.accent;
|
|
selected_bg = c.overlay;
|
|
selected_fg = c.text;
|
|
inactive_fg = c.muted;
|
|
graph_text = c.subtext;
|
|
meter_bg = c.surface;
|
|
proc_misc = c.accentAlt;
|
|
cpu_box = c.accent;
|
|
mem_box = c.good;
|
|
net_box = c.accentAlt;
|
|
proc_box = c.surface;
|
|
div_line = c.overlay;
|
|
temp_start = c.good;
|
|
temp_mid = c.warn;
|
|
temp_end = c.bad;
|
|
cpu_start = c.good;
|
|
cpu_mid = c.warn;
|
|
cpu_end = c.bad;
|
|
free_start = c.good;
|
|
used_start = c.warn;
|
|
download_start = c.accent;
|
|
upload_start = c.accentAlt;
|
|
};
|
|
in
|
|
lib.concatStringsSep "\n"
|
|
(lib.mapAttrsToList (k: v: "theme[${k}]=\"${v}\"") pairs) + "\n";
|
|
in
|
|
{
|
|
config = lib.mkIf config.nomarchy.btop.enable {
|
|
programs.btop = {
|
|
enable = true;
|
|
settings = {
|
|
color_theme = "nomarchy";
|
|
theme_background = false; # let the terminal's opacity show through
|
|
vim_keys = true;
|
|
};
|
|
};
|
|
|
|
xdg.configFile."btop/themes/nomarchy.theme" =
|
|
if builtins.pathExists asset
|
|
then { source = asset; }
|
|
else { text = generated; };
|
|
};
|
|
}
|