test: permanent V2 checks for airplane (#104) and fastfetch logo (#122)
Some checks failed
Check / eval (push) Has been cancelled
Some checks failed
Check / eval (push) Has been cancelled
Move nomarchy-airplane to pkgs/ so checks can import it. checks.airplane covers the session state machine, menu/keybind surfaces, and whole-swap waybar parity (mocked nmcli; live radios stay V3). checks.fastfetch-logo asserts the baked mark is sextant-based with the module flags locked in.
This commit is contained in:
85
flake.nix
85
flake.nix
@@ -90,6 +90,7 @@
|
||||
nomarchy-first-boot = final.callPackage ./pkgs/nomarchy-first-boot { };
|
||||
nomarchy-what-changed = final.callPackage ./pkgs/nomarchy-what-changed { };
|
||||
nomarchy-detect-hw = final.callPackage ./pkgs/nomarchy-detect-hw { };
|
||||
nomarchy-airplane = final.callPackage ./pkgs/nomarchy-airplane { };
|
||||
# pull / rebuild / home (+ legacy aliases) — also on HM so a home
|
||||
# switch can refresh a broken system-package nomarchy-pull.
|
||||
# Includes nomarchy-what-changed (generation readability, #82).
|
||||
@@ -521,6 +522,90 @@
|
||||
assert assertMsg ok ("keybinds-cheatsheet: " + msg);
|
||||
pkgs.runCommand "nomarchy-keybinds-cheatsheet" { } "touch $out";
|
||||
|
||||
# Airplane mode (#104): mocked nmcli round-trip — engage kills
|
||||
# Wi-Fi, disengage restores prior; already-off Wi-Fi stays off;
|
||||
# status self-hides while off. Real radios are V3 (HARDWARE-QUEUE).
|
||||
airplane = pkgs.runCommand "nomarchy-airplane"
|
||||
{ nativeBuildInputs = [ pkgs.bash pkgs.coreutils pkgs.gnugrep ]; }
|
||||
''
|
||||
set -eu
|
||||
air=${pkgs.nomarchy-airplane}/bin/nomarchy-airplane
|
||||
# Headless stubs: real nmcli/rfkill need a machine bus; the
|
||||
# state-machine + Waybar self-hide contract is what we assert
|
||||
# here. Prior-restore against live radios is V3.
|
||||
# Shebang must be an absolute store bash — pure sandbox has
|
||||
# no /usr/bin/env.
|
||||
mock=$(mktemp -d)
|
||||
shebang='#!${pkgs.bash}/bin/bash'
|
||||
for c in nmcli rfkill bluetoothctl notify-send pkill; do
|
||||
printf '%s\n' "$shebang" 'true' > "$mock/$c"
|
||||
chmod +x "$mock/$c"
|
||||
done
|
||||
# wifi_enabled reads nmcli -t -f WIFI g → report "enabled"
|
||||
printf '%s\n' "$shebang" \
|
||||
'case "$*" in' \
|
||||
'"-t -f WIFI g") echo enabled ;;' \
|
||||
'*) true ;;' \
|
||||
'esac' > "$mock/nmcli"
|
||||
chmod +x "$mock/nmcli"
|
||||
export PATH="$mock:$PATH"
|
||||
|
||||
rt=$(mktemp -d)
|
||||
export XDG_RUNTIME_DIR=$rt
|
||||
[ "$($air is-active)" = off ]
|
||||
[ -z "$($air status)" ]
|
||||
$air on
|
||||
[ "$($air is-active)" = on ]
|
||||
$air status | grep -q '"class":"on"'
|
||||
[ -f "$rt/nomarchy-airplane.state" ]
|
||||
grep -q 'wifi_prior=1' "$rt/nomarchy-airplane.state"
|
||||
$air off
|
||||
[ "$($air is-active)" = off ]
|
||||
[ -z "$($air status)" ]
|
||||
[ ! -f "$rt/nomarchy-airplane.state" ]
|
||||
|
||||
grep -q 'airplane' ${./modules/home/rofi.nix}
|
||||
grep -q 'Airplane mode' ${./modules/home/rofi.nix}
|
||||
grep -q 'nomarchy-menu airplane' ${./modules/home/keybinds.nix}
|
||||
for t in boreal executive-slate summer-day summer-night; do
|
||||
grep -q 'custom/airplane' ${./themes}/$t/waybar.jsonc
|
||||
grep -q 'custom-airplane' ${./themes}/$t/waybar.css
|
||||
done
|
||||
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# Fastfetch logo (#122): baked logo must be sextant-based (not
|
||||
# the old half/full-block grid). Visual quality is V2 kitty /
|
||||
# hardware; this asserts the renderer flag actually landed.
|
||||
fastfetch-logo =
|
||||
let
|
||||
logo = pkgs.runCommand "nomarchy-fastfetch-logo-check"
|
||||
{ nativeBuildInputs = [ pkgs.imagemagick pkgs.librsvg pkgs.chafa ]; }
|
||||
''
|
||||
rsvg-convert -w 360 ${./modules/nixos/branding/logo.svg} > logo.png
|
||||
magick logo.png -fill "#B79BE8" -colorize 100 logo-c.png
|
||||
chafa --format symbols --symbols sextant --size 24x12 \
|
||||
--colors full --polite on logo-c.png > $out
|
||||
'';
|
||||
in
|
||||
pkgs.runCommand "nomarchy-fastfetch-logo"
|
||||
{ nativeBuildInputs = [ pkgs.python3 ]; }
|
||||
''
|
||||
set -eu
|
||||
grep -q 'symbols sextant' ${./modules/home/fastfetch.nix}
|
||||
grep -q 'size 24x12' ${./modules/home/fastfetch.nix}
|
||||
python3 - <<'PY'
|
||||
from pathlib import Path
|
||||
t = Path("${logo}").read_text(encoding="utf-8")
|
||||
sext = sum(1 for c in t if 0x1FB00 <= ord(c) <= 0x1FBFF)
|
||||
if sext < 20:
|
||||
raise SystemExit(f"too few sextant chars: {sext}")
|
||||
print(f"fastfetch-logo: {sext} sextant chars")
|
||||
PY
|
||||
touch $out
|
||||
'';
|
||||
|
||||
# Installer keyboard no-variant regression (item 91): gum's `(none)`
|
||||
# row is display-only. Exercise it through the real template
|
||||
# patcher, then build the exact us + empty-variant console keymap
|
||||
|
||||
Reference in New Issue
Block a user