Files
Nomarchy/pkgs/nomarchy-state-sync/default.nix
Bernardo Magri 76941c55b7 fix(waybar): bar pokes missed the wrapped process — switches never touched the bar
nixpkgs wraps waybar, so the running comm is `.waybar-wrapped`:
`pkill -x waybar` (state-sync restart/SIGUSR2 branches, tz-watch,
updates) matched nothing — a theme switch neither restarted nor reloaded
the bar, which then kept the gtk.css of whatever theme it started under
(the stale workspace-digit colors reported 2026-07-18; companion gtk fix
in the next commit). The unanchored pokes (recording, airplane,
theme-shot) had the opposite bug: `waybar` substring-matches the
supervisor's `nomarchy-waybar` comm too, and an unhandled RTMIN
terminates its bash — the pokes were killing the crash guard. All seven
sites now use `pkill … -x 'waybar|\.waybar-wrapped'`.
state-sync 0.5.1 → 0.5.2.

Verified live on Newton (V3-grade): new pattern restarts the bar under
the supervisor (fresh pid, supervisor alive); RTMIN+10 poke reaches the
bar, supervisor survives. V0 `nix flake check --no-build` + py_compile;
V1 HM generation + system toplevel build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 11:04:08 +01:00

54 lines
1.6 KiB
Nix

{ lib
, stdenvNoCC
, python3
, makeWrapper
, awww
, libnotify
, git
# Shipped theme presets, baked into the package as a fallback so
# `list`/`apply` work even when $NOMARCHY_PATH has no themes/ dir.
# Already a store artifact (nomarchy-default-themes merges the repo's
# ./themes with backgrounds/ symlinked from nomarchy-wallpapers) — the
# wrapper points straight at it, no copy, so it stays in the closure
# without duplicating it into $out.
, themesDir ? null
}:
stdenvNoCC.mkDerivation {
pname = "nomarchy-state-sync";
version = "0.5.2";
src = ./.;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 ];
installPhase = ''
runHook preInstall
install -Dm755 nomarchy-state-sync.py $out/bin/nomarchy-state-sync
patchShebangs $out/bin/nomarchy-state-sync
# Stdlib-only Python. home-manager is deliberately NOT wrapped in
# the rebuild must use the user's own home-manager from their PATH.
wrapProgram $out/bin/nomarchy-state-sync \
--prefix PATH : ${lib.makeBinPath [ awww libnotify git ]} \
${lib.optionalString (themesDir != null)
"--set NOMARCHY_DEFAULT_THEMES ${themesDir}"}
# #107: old CLI name kept as a symlink so muscle memory and scripts
# survive a pull (drop after the next stable release notes say so).
# After wrapProgram so it points at the wrapper, not the raw script.
ln -s nomarchy-state-sync $out/bin/nomarchy-theme-sync
runHook postInstall
'';
meta = {
description = "Nomarchy state writer + Home Manager rebuild dispatcher";
license = lib.licenses.mit;
mainProgram = "nomarchy-state-sync";
platforms = lib.platforms.linux;
};
}