nixos/settings/desktop.nix
rope 1091495674 theming: re-theme every app on wallpaper switch, crossfade wallpaper
settings/theming.nix renders a full config set per wallpaper (GTK, ghostty,
btop, hyprland, vesktop, zen, folder icons) from its own base16 palette;
theme-apply swaps them in and reloads what can reload.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 14:31:24 +01:00

93 lines
4.2 KiB
Nix

# settings/desktop.nix — display manager, lightweight fallback session, GTK/Qt theming
{ config, pkgs, lib, inputs, ... }:
{
config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) {
services.xserver.enable = true;
# Autologin straight into Hyprland; the quickshell lockscreen engages
# immediately (see Lock.qml), so the lock *is* the login prompt.
services.greetd = {
enable = true;
# We handle the plymouth handoff ourselves below — don't wait for
# plymouth-quit-wait (that wait is what dropped boot to a console
# flash between splash and Hyprland).
greeterManagesPlymouth = true;
settings.default_session = {
# start-hyprland prints an ASCII logo to the VT, which repaints the
# console over the retained splash frame — silence it (Hyprland still
# logs to $XDG_RUNTIME_DIR/hypr/*/hyprland.log).
command = toString (pkgs.writeShellScript "hyprland-session" ''
exec ${config.programs.hyprland.package}/bin/start-hyprland >/dev/null 2>&1
'');
user = "fred";
};
};
# GDM-style splash→session handoff: nothing else quits plymouth at boot;
# greetd freezes the last splash frame (--retain-splash) right before it
# spawns Hyprland, which then flips straight to the lockscreen.
systemd.services.plymouth-quit.wantedBy = lib.mkForce [ ];
# ...and plymouth-quit-wait must go too: greetd is Type=idle, so it defers
# its ExecStart while any job is pending — and the only pending job is
# plymouth-quit-wait, which waits for the splash that greetd itself quits.
# That circle only broke on systemd's 5s idle timeout, costing 6s of boot.
systemd.services.plymouth-quit-wait.wantedBy = lib.mkForce [ ];
systemd.services.greetd = {
after = [ "plymouth-start.service" ];
serviceConfig.ExecStartPre = "-${pkgs.plymouth}/bin/plymouth quit --retain-splash";
};
boot.plymouth.enable = true;
boot.initrd.verbose = false;
boot.consoleLogLevel = 3;
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
# Flatpak for ad-hoc app installs via Bazaar
services.flatpak.enable = true;
# Secret Service for Chromium/Electron credential encryption.
# Autologin can't unlock the keyring (no password typed), so greetd only
# *starts* the daemon; the quickshell lockscreen authenticates against the
# "login" PAM service, where pam_gnome_keyring unlocks it on first unlock.
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
security.pam.services.login.enableGnomeKeyring = true;
environment.systemPackages = with pkgs; [
nemo # file manager
gnome-themes-extra
papirus-icon-theme
];
# Cursor theme — stylix.cursor in settings/stylix.nix owns the choice.
environment.sessionVariables = {
XCURSOR_THEME = "Bibata-Modern-Ice";
XCURSOR_SIZE = "24";
XCURSOR_PATH = lib.mkForce [
"${pkgs.bibata-cursors}/share/icons"
"$HOME/.icons"
"$HOME/.local/share/icons"
];
};
programs.xwayland.enable = true;
programs.dconf.enable = true;
home-manager.users.fred = {
# Stylix's qt target only supports qtct; disable it to silence the warning.
stylix.targets.qt.enable = false;
# Minimal titlebars. The GTK stylesheet itself — stylix's colours plus
# our headerbar shrink and surface-tint overrides — is rendered per
# wallpaper and swapped at runtime in settings/theming.nix.
gtk.enable = true;
dconf.settings."org/nemo/window-state".start-with-menu-bar = false;
# GTK3 ignores dconf's color-scheme=prefer-dark — it only picks
# adw-gtk3's gtk-dark.css when this setting is on. Without it GTK3 apps
# (nemo) load the *light* sheet; the @define-color overrides repaint
# most of it, but colours sass baked in as literals survive — e.g.
# `messagedialog.csd.background button { color: rgba(0,0,6,0.8); }`, which
# is why nemo's delete confirmation had near-black buttons on dark bg.
gtk.gtk3.extraConfig.gtk-application-prefer-dark-theme = true;
};
};
}