nixos/settings/gnome.nix
ediblerope 1bf08d2097 stylix: full migration off matugen
Flips stylix.autoEnable on so every supported target picks up colours
from the wallpaper-derived base16 palette, and tears out the per-app
matugen plumbing it replaces:

- fred.nix: drop the matugen config.toml block and the .keep files;
  move btop and ghostty to programs.* with the colour-bearing options
  removed (stylix owns those).
- gnome.nix: remove the matugen and jq packages, the hand-written
  gtk.css home.file overrides (replaced by gtk.gtk{3,4}.extraCss layered
  on top of stylix's theme), the WallpaperShell user-themes override,
  and the gtk-theme/cursor-theme/accent-color dconf entries that stylix
  now writes.
- stylix.nix: add a home.activation hook that recolours Adwaita folder
  SVGs using stylix.colors.base0D and pulls in Papirus mimetypes —
  same outcome as the old matugen post-hook but driven by stylix.
- common.nix: drop the matugen invocation from the `update` alias.

Leftover matugen-only behaviour intentionally dropped: Vesktop CSS,
the GNOME accent hue-mapping, the VSCodium colour-merge (stylix's
vscode target handles that natively). Templates in templates/ are kept
on disk for now; can be removed in a follow-up.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 19:44:19 +01:00

147 lines
4.4 KiB
Nix

{ config, pkgs, lib, inputs, ... }:
{
config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) {
# Enable Gnome
services.xserver.enable = true;
services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true;
services.displayManager.gdm.wayland = true;
boot.plymouth.enable = false;
# Flatpak for ad-hoc app installs via Bazaar
services.flatpak.enable = true;
# Add extensions, packages, and terminal
environment.systemPackages = with pkgs; [
ghostty
gnomeExtensions.blur-my-shell
gnomeExtensions.just-perfection
gnomeExtensions.appindicator
gnomeExtensions.hot-edge
adwaita-icon-theme
gnome-themes-extra
adwaita-icon-theme-legacy
papirus-icon-theme
];
# Set cursor theme
environment.sessionVariables = {
XCURSOR_THEME = "Adwaita";
XCURSOR_SIZE = "24";
XCURSOR_PATH = lib.mkForce [
"${pkgs.adwaita-icon-theme}/share/icons"
"$HOME/.icons"
"$HOME/.local/share/icons"
];
};
# mutter VRR — stylix handles theme/icon dconf entries
programs.dconf.profiles.user.databases = [{
settings = {
"org/gnome/desktop/interface" = {
icon-theme = "WallpaperAdwaita";
};
"org/gnome/mutter" = {
experimental-features = [ "variable-refresh-rate" ];
};
};
}];
qt = {
enable = true;
platformTheme = "gnome";
style = "adwaita-dark";
};
programs.xwayland.enable = true;
programs.dconf.enable = true;
# Home Manager GNOME settings
home-manager.users.fred = { config, lib, pkgs, ... }: {
# Minimal titlebars — stylix manages the GTK theme; we layer our
# headerbar shrink on top via programs.gtk.*.extraCss.
gtk = {
enable = true;
gtk3.extraCss = ''
headerbar { min-height: 0; padding: 0; margin: 0; }
headerbar .title { font-size: 0; }
'';
gtk4.extraCss = ''
headerbar { min-height: 0; padding: 0; margin: 0; }
headerbar .title { font-size: 0; }
window:backdrop {
background-color: @window_bg_color;
color: @window_fg_color;
}
window:backdrop headerbar {
background-color: @headerbar_bg_color;
color: @headerbar_fg_color;
}
'';
};
# GNOME dconf settings — stylix owns colour-scheme, gtk-theme,
# cursor-theme and accent-color now.
dconf.settings = {
"org/gnome/desktop/interface" = {
enable-hot-corners = false;
};
# Wallpaper settings
"org/gnome/desktop/background" = {
picture-uri = "file://${config.home.homeDirectory}/.local/share/backgrounds/wallpaper.png";
picture-uri-dark = "file://${config.home.homeDirectory}/.local/share/backgrounds/wallpaper.png";
picture-options = "zoom";
};
# Keyboard input sources
"org/gnome/desktop/input-sources" = {
sources = [
(lib.hm.gvariant.mkTuple [ "xkb" "gb" ])
(lib.hm.gvariant.mkTuple [ "xkb" "no" ])
];
};
# Window manager keybindings
"org/gnome/desktop/wm/keybindings" = {
close = ["<Super>q"];
toggle-fullscreen = ["<Super>f"];
};
"org/gnome/desktop/wm/preferences" = {
resize-with-right-button = lib.hm.gvariant.mkBoolean true;
button-layout = "";
};
# Shell keybindings
"org/gnome/shell/keybindings" = {
show-screenshot-ui = ["<Shift><Super>s"];
};
# Custom keybindings
"org/gnome/settings-daemon/plugins/media-keys" = {
home = ["<Super>e"];
control-center = ["<Super>i"];
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
name = "Terminal";
command = "ghostty";
binding = "<Super>t";
};
# Mouse acceleration
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
# Just Perfection extension
"org/gnome/shell/extensions/just-perfection" = {
window-demands-attention-focus = true;
};
};
};
};
}