diff --git a/AGENTS.md b/AGENTS.md index c68feee0..16f502ff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,9 +15,10 @@ deployments. Keep repository guidance here; reusable global rules live in `agent instead of hardcoding usernames or paths. - `secrets/` contains agenix definitions; secret material also comes from a private external repo. - `overlays/` and `hardening/` hold package overlays and hardened (nixpak/bwrap) wrappers. -- Noctalia (the Wayland shell) is configured in `home/linux/gui/base/noctalia/config/config.toml`, - which the `programs.noctalia` module validates at build time. Host-specific overrides go in a - `host-.toml` there (merged after `config.toml`). +- Noctalia (the Wayland shell) baseline is `home/linux/gui/base/noctalia/config/config.toml`, + symlinked out of store into `~/.config/noctalia/` so edits hot reload without a rebuild. Settings + UI changes stay in the state layer (`~/.local/state/noctalia/settings.toml`, loads last). Host + overrides go in a `host-.toml` there (merged after `config.toml`). ## Commands and Platforms diff --git a/home/hosts/linux/12kingdoms-shoukei.nix b/home/hosts/linux/12kingdoms-shoukei.nix index 6d7ca7b2..76da787c 100644 --- a/home/hosts/linux/12kingdoms-shoukei.nix +++ b/home/hosts/linux/12kingdoms-shoukei.nix @@ -24,7 +24,8 @@ in xdg.configFile."niri/niri-hardware.kdl".source = mkSymlink "${config.home.homeDirectory}/nix-config/hosts/12kingdoms-shoukei/niri-hardware.kdl"; - # Host-specific Noctalia config; merges after the shared config.toml. + # Host-specific Noctalia config; sorts after the shared config.toml, so it can + # override the shared baseline. xdg.configFile."noctalia/host-shoukei.toml".source = ./12kingdoms-shoukei/noctalia.toml; # The built-in laptop speakers are quiet, so boost above the -23 dB default. diff --git a/home/linux/gui/base/README.md b/home/linux/gui/base/README.md index 1bcf4cbd..464050a2 100644 --- a/home/linux/gui/base/README.md +++ b/home/linux/gui/base/README.md @@ -15,23 +15,27 @@ The configuration is organized into modular components that can be selectively e ## Noctalia **Noctalia** (v5) is a native C++/Wayland all-in-one desktop shell that replaces multiple separate -tools with a single, unified solution. It is installed and configured through the upstream +tools with a single, unified solution. It is installed through the upstream [`programs.noctalia`](https://docs.noctalia.dev/noctalia/getting-started/nixos/) Home Manager -module, which validates the TOML at build time. +module. ### Configuration Noctalia merges **every `*.toml` in the config directory** (`~/.config/noctalia/`), sorted -alphabetically, and then layers the Settings UI's own overrides on top: +alphabetically, and then layers the state directory's `settings.toml` on top: -| Layer | Location | Notes | -| -------------------- | ----------------------------------------------------------------- | ----------------------------------------------- | -| Declarative baseline | `~/.config/noctalia/*.toml` (repo: `noctalia/config/config.toml`) | Merged alphabetically; `[include]` supported | -| GUI overrides | `~/.local/state/noctalia/settings.toml` | Written by the Settings UI; loads last and wins | +| Layer | Location | Notes | +| ------ | --------------------------------------- | --------------------------------------------------------------------- | +| Config | `~/.config/noctalia/*.toml` | Merged alphabetically; `[include]` supported; host-specific overrides | +| State | `~/.local/state/noctalia/settings.toml` | Written by the Settings UI; loads last and wins | -`noctalia config export merged` prints the effective user config and `noctalia config validate` -checks a file. Application theming stays with `catppuccin/nix`, so Noctalia's theme templates are -disabled. +The shared baseline (`noctalia/config/config.toml`) is deployed as an **out-of-store symlink**, so +manual edits hot-reload without a `home-manager switch`. Noctalia never rewrites files in the config +layer, so volatile runtime data (wallpaper rotation, widget geometry) stays in the state file and +out of the repository. + +`noctalia config export` prints the merged user config and `noctalia config validate` checks a file. +Application theming stays with `catppuccin/nix`, so Noctalia's theme templates are disabled. ### Component Replacement @@ -54,8 +58,9 @@ Noctalia consolidates functionality that previously required multiple tools: ### Desktop Shell - **[`noctalia/default.nix`](./noctalia/default.nix)**: enables the upstream `programs.noctalia` - module -- **[`noctalia/config/config.toml`](./noctalia/config/config.toml)**: declarative baseline (v5 TOML) + module and symlinks the baseline out of store +- **[`noctalia/config/config.toml`](./noctalia/config/config.toml)**: declarative baseline (v5 + TOML), tracked in the repo and hot-reloaded Key features: bar and widgets, control center, desktop widgets, night light, wallpaper, session panel, screenshots with annotation, system monitor, audio/volume, brightness, calendar/weather, diff --git a/home/linux/gui/base/noctalia/config/config.toml b/home/linux/gui/base/noctalia/config/config.toml index b4d59e0d..b3cdc7fc 100644 --- a/home/linux/gui/base/noctalia/config/config.toml +++ b/home/linux/gui/base/noctalia/config/config.toml @@ -1,6 +1,9 @@ -# Noctalia v5 — minimal declarative baseline. -# Everything else is tuned in the Settings UI: those changes go to -# ~/.local/state/noctalia/settings.toml (persisted) and take precedence. +# Noctalia v5 declarative baseline. +# +# This file is symlinked out of store into ~/.config/noctalia/config.toml, so +# edits hot-reload without a home-manager switch. Noctalia never rewrites files +# in the config layer; Settings UI changes go to +# ~/.local/state/noctalia/settings.toml, which loads after this file and wins. [accessibility] # Content scale for panels and other non-bar shell UI. diff --git a/home/linux/gui/base/noctalia/default.nix b/home/linux/gui/base/noctalia/default.nix index db018b59..c3eabcc4 100644 --- a/home/linux/gui/base/noctalia/default.nix +++ b/home/linux/gui/base/noctalia/default.nix @@ -1,4 +1,5 @@ { + config, lib, pkgs, wallpapers, @@ -6,16 +7,19 @@ }: { - # Use the upstream Home Manager module (shipped by home-manager itself): it - # installs pkgs.noctalia, validates the TOML at build time via `checkConfig`, - # and handles custom palettes. Runtime changes made in the Settings UI keep - # working: they go to ~/.local/state/noctalia/settings.toml, which loads after - # this file and wins. + # Use the upstream Home Manager module (shipped by home-manager itself) for + # the package. The config file is not deployed through `programs.noctalia.settings`: + # that writes a store symlink, so every edit needs a home-manager switch. # https://docs.noctalia.dev/noctalia/getting-started/nixos/#home-manager - programs.noctalia = { - enable = true; - settings = ./config/config.toml; - }; + programs.noctalia.enable = true; + # Deploy the baseline as an out-of-store symlink in the config layer. Noctalia + # never rewrites files under ~/.config/noctalia/, so manual edits hot-reload + # without a switch, while Settings UI changes stay in the state layer + # (~/.local/state/noctalia/settings.toml), which loads last and wins - keeping + # volatile runtime data (wallpaper rotation, widget geometry) out of the repo. + # Host-specific tweaks are separate config-layer files (~/.config/noctalia/host-.toml). + xdg.configFile."noctalia/config.toml".source = + config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/home/linux/gui/base/noctalia/config/config.toml"; # Noctalia v5 is started by niri's spawn-at-startup (see the niri conf), so # app2unit is still used to launch desktop entries as systemd user units.