feat(macos): Alacritty follows system light/dark appearance

New setup — due for review after you run darwin-rebuild switch and
live with it for a few days. See CLAUDE.md (Alacritty) and
assets/alacritty/README.md.

- HM: import active-colors.toml + Catppuccin latte/mocha fragments
- nix-darwin: launchd.user.agents.alacritty-system-theme + PATH helper
- fish: background sync on Darwin; theme.sh no longer rebuilds for Alacritty
- Remove switch-alacritty-theme.sh (sed + darwin-rebuild per toggle)

Made-with: Cursor
This commit is contained in:
DannyDannyDanny 2026-03-23 19:16:05 +01:00
parent 18ccebc109
commit b311e21d5b
15 changed files with 196 additions and 293 deletions

View file

@ -1,6 +1,9 @@
{ config, lib, pkgs, ... }:
{
let
alacrittySyncSystemTheme = pkgs.writeShellScriptBin "alacritty-sync-system-theme"
(builtins.readFile ../../scripts/alacritty-sync-system-theme.sh);
in {
# Apple Silicon + nix-darwin basics
nixpkgs.hostPlatform = "aarch64-darwin";
nix.enable = false; # Determinate manages Nix
@ -48,6 +51,19 @@
# User-specific packages and environment variables are now in home-manager (home.nix)
# Only system-level packages should remain here if needed
environment.systemPackages = [ alacrittySyncSystemTheme ];
# Poll macOS appearance; updates ~/.config/alacritty/active-colors.toml (Alacritty live_config_reload).
launchd.user.agents.alacritty-system-theme = {
serviceConfig = {
RunAtLoad = true;
StartInterval = 30;
ProgramArguments = [ "${alacrittySyncSystemTheme}/bin/alacritty-sync-system-theme" ];
StandardOutPath = "/tmp/alacritty-theme-sync.log";
StandardErrorPath = "/tmp/alacritty-theme-sync-error.log";
};
};
# Keep for darwin as well (tracks defaults across upgrades)
# current max per nix-darwin; bump only if a release notes says so
system.stateVersion = 6;