Files
NixOsConfig/modules/theme/stylix.nix
T
Claude af18420fd3 Switch to the dendritic flake-parts layout, with stubs for phase 2
flake.nix now only declares inputs and calls flake-parts with import-tree
over ./modules: every .nix file under modules/ is a flake-parts module.
Features are aspects (flake.modules.nixos.<name> and
flake.modules.homeManager.<name>); importing an aspect enables it, so the
my.* option modules and their enable flags are gone.

- Add the flake-parts glue: modules/flake/ (systems, shared meta data,
  host construction through configurations.nixos, overlays, packages,
  apps, dev shell, formatter, checks), modules/users/faumaray.nix
  (meta.owner) and modules/core/{nixpkgs,home-manager,install-facts}.nix.
  config.my is kept as one read-only derived option so install-system
  keeps working unchanged.
- Add the aspects that are already final: secrets, ssh, hyprland,
  wezterm, git, stylix, proxy-suite, gitea-runner and claude-code, and
  the desktop host (modules/hosts/desktop/{host,hardware,disks}.nix).
- Port the always-on basics to the `core` aspect (nix, boot, locale,
  networking, users), lanzaboote and plain systemd-boot to the
  `secure-boot` and `systemd-boot` aspects, and the installer ISO to
  modules/installer/iso.nix. Behaviour is unchanged; the time zone,
  default locale, XKB layouts and the firewall setting now live in
  modules/hosts/desktop/host.nix.
- Move the Lua files (Hyprland settings, binds, rules; Neovim init.lua)
  with git mv, byte-identical.
- Add bare stubs, marked STUB, for the aspects that the next phase
  ports: amd, rocm, gaming, vpn, docker, noctalia, audio, fonts, xdg,
  apps, shell and neovim. The host evaluates with them, but those
  features are not configured until they are ported.
- Remove lib/, overlays/, apps/, modules/nixos/, modules/home/,
  modules/installer/default.nix and hosts/desktop/{default,disks,home}.nix.
- flake.lock: add flake-parts, import-tree, stylix and serena with their
  transitive inputs (22 new nodes); every existing pin is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
2026-10-12 20:55:34 +00:00

141 lines
4.6 KiB
Nix

# Theme: one palette, fonts, cursor and icons for the whole desktop, applied by
# Stylix (github:nix-community/stylix).
# NixOS Stylix itself (its home-manager module is added to every
# home-manager user and inherits these settings), the TTY
# palette and the default font families.
# home-manager which programs Stylix themes.
# Targets are opt-in (`autoEnable = false`): Stylix touches only what is listed
# here. A new program that Stylix supports gets its `stylix.targets.<name>`
# line in this file.
{ config, inputs, ... }:
let
inherit (config.meta) owner;
hmTheme = config.flake.modules.homeManager.theme;
in
{
flake.modules.nixos.theme =
{ pkgs, ... }:
{
imports = [ inputs.stylix.nixosModules.stylix ];
home-manager.users.${owner.name}.imports = [ hmTheme ];
stylix = {
enable = true;
# With autoEnable Stylix would also write GNOME, KDE, X resources, gedit,
# gdu, Blender, ... configs and rebuild gtksourceview through an overlay.
autoEnable = false;
polarity = "dark";
# Catppuccin Mocha, from tinted-theming/schemes base16/catppuccin-mocha.yaml.
# Inline, so evaluation needs no import-from-derivation. Another scheme:
# base16Scheme = "${pkgs.base16-schemes}/share/themes/<name>.yaml";
base16Scheme = {
scheme = "Catppuccin Mocha";
author = "https://github.com/catppuccin/catppuccin";
slug = "catppuccin-mocha";
variant = "dark";
base00 = "1e1e2e"; # base
base01 = "181825"; # mantle
base02 = "313244"; # surface0
base03 = "45475a"; # surface1
base04 = "585b70"; # surface2
base05 = "cdd6f4"; # text
base06 = "f5e0dc"; # rosewater
base07 = "b4befe"; # lavender
base08 = "f38ba8"; # red
base09 = "fab387"; # peach
base0A = "f9e2af"; # yellow
base0B = "a6e3a1"; # green
base0C = "94e2d5"; # teal
base0D = "89b4fa"; # blue
base0E = "cba6f7"; # mauve
base0F = "f2cdcd"; # flamingo
};
# No wallpaper: Noctalia draws it, so every Stylix wallpaper part stays off.
image = null;
fonts = {
monospace = {
package = pkgs.monaspace;
name = "Monaspace Radon";
};
sansSerif = {
package = pkgs.inter;
name = "Inter";
};
serif = {
package = pkgs.noto-fonts;
name = "Noto Serif";
};
emoji = {
package = pkgs.noto-fonts-color-emoji;
name = "Noto Color Emoji";
};
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
icons = {
enable = true;
package = pkgs.papirus-icon-theme;
dark = "Papirus-Dark";
light = "Papirus-Light";
};
targets = {
# TTY palette (vt.default_{red,grn,blu} kernel parameters).
console.enable = true;
# fontconfig default families from `fonts` above, and their packages.
fontconfig.enable = true;
font-packages.enable = true;
# programs.dconf, which home-manager's GTK settings need.
gtk.enable = true;
};
};
};
flake.modules.homeManager.theme = {
stylix.targets = {
gtk = {
enable = true;
# No Flatpak here: do not write ~/.themes or Flatpak overrides.
flatpakSupport.enable = false;
};
qt.enable = true;
hyprland.enable = true;
noctalia = {
enable = true;
# Keep Noctalia's own panel opacities and the shell font chosen for it.
opacity.enable = false;
fonts.override.sansSerif.name = "Monaspace Krypton";
};
wezterm = {
enable = true;
fonts.override.monospace.name = "Monaspace Krypton";
};
bat.enable = true;
btop.enable = true;
fzf.enable = true;
starship.enable = true;
mpv.enable = true;
zathura.enable = true;
# Not enabled:
# - neovim: cli/neovim/init.lua still sets the catppuccin colorscheme;
# Stylix's mini.base16 would run after it and stack a second one.
# - firefox: needs a declared profile (programs.firefox.profiles);
# declaring one would replace the existing Firefox profile.
};
# libadwaita/GTK 4 apps read the preference from dconf.
gtk.colorScheme = "dark";
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
};
}