feat(desktop): theme the graphical layer Nord with Stylix (task 0022)

Add Stylix as a flake input and a desktop theming module that resolves a
single Nord base16 scheme across the graphical surface: GTK, Qt, cursor,
and the system monospace font, plus a static Nord wallpaper drawn as a
Polar Night gradient.

Scope the theming to the graphical layer alone. The Stylix targets for
fish (at both system and home-manager level), tmux, and nixvim stay off
so the terminal tools keep their hand-written themes.
This commit is contained in:
2026-07-22 10:28:03 -04:00
parent 5ca717ca4a
commit 27a28b1ae7
6 changed files with 384 additions and 6 deletions

View File

@@ -12,5 +12,6 @@ in
modules.desktop.hyprland.enable = lib.mkDefault true;
modules.desktop.login.enable = lib.mkDefault true;
modules.desktop.terminal.enable = lib.mkDefault true;
modules.desktop.theming.enable = lib.mkDefault true;
};
}

View File

@@ -0,0 +1,65 @@
{
config,
lib,
pkgs,
...
}:
# Nord theming for the graphical layer, driven from one base16 scheme by Stylix.
let
cfg = config.modules.desktop.theming;
user = config.user.name;
# A single static Nord wallpaper, drawn as a vertical gradient across the
# Polar Night shades so it needs no committed binary and no network fetch.
wallpaper = pkgs.runCommand "nord-wallpaper.png" { } ''
${pkgs.imagemagick}/bin/magick \
-size 2560x1440 gradient:'#2E3440'-'#3B4252' \
"$out"
'';
in
{
options.modules.desktop.theming.enable =
lib.mkEnableOption "Nord theming of the graphical layer via Stylix";
config = lib.mkIf cfg.enable {
stylix = {
enable = true;
# Nord is a dark scheme.
# The polarity steers Stylix's contrast choices.
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/nord.yaml";
image = wallpaper;
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
fonts.monospace = {
package = pkgs.jetbrains-mono;
name = "JetBrains Mono";
};
# fish is also installed at system level, so its theming has a target
# here of its own.
targets.fish.enable = false;
};
home-manager.users.${user} = {
# Stylix drives the cursor through home-manager's pointer-cursor config,
# whose generation must be switched on explicitly.
home.pointerCursor.enable = true;
# nvim, tmux, and fish are configured through home-manager and keep their
# own hand-written themes, so their Stylix targets stay off.
stylix.targets = {
fish.enable = false;
tmux.enable = false;
nixvim.enable = false;
};
};
};
}