Files
komorebi/nix/linux/tests/keybindings.nix
T
LGUG2Z 05698a34ba fix(nix): the nix files read the final directories
The pure moves put the KDE and macOS nix files under nix/linux and nix/macos but left the
relative paths they read: the JSON schema (now schemas/linux and schemas/macos), the example
configurations and key binding samples (docs/linux, docs/macos), the key binding fixtures
(komorebi-hotkeys at the top level), the wsl2 probe script (scripts/linux). Each path now
names the file in the final directory, one more directory up because the files are one level
deeper.

Not touched: flake.nix and the nested flakes (next revisions), which still name the old paths.

Verified: not verified (nothing evaluates until the flake is rewritten; the new flake checks
these paths).
2026-11-05 15:03:27 -08:00

39 lines
1.4 KiB
Nix

# `keybindings-fixtures`: every key binding file of the fixture corpus
# (komorebi-hotkeys/tests/fixtures) through `komorebic hotkeys compile --mode auto --dry-run`,
# the command the NixOS module runs, compared with `keybindings.expected`: the static shortcuts of
# each file, the bindings left to the engine, and the diagnostics, as the build log of the module
# shows them. After a change that means to change them, write the file again with the loop below,
# run in the fixtures directory, and read the difference. The sample files of the user guide,
# docs/*.sample, are the corpus's case `sample`, which this checks too.
{
pkgs,
# a package with bin/komorebic
komorebic,
}:
let
inherit (pkgs) lib;
in
pkgs.runCommand "keybindings-fixtures"
{
fixtures = ../../../komorebi-hotkeys/tests/fixtures;
expected = ./keybindings.expected;
samples = lib.fileset.toSource {
root = ../../../docs/linux;
fileset = lib.fileset.fileFilter (file: file.hasExt "sample") ../../../docs/linux;
};
}
''
for format in skhdrc whkdrc sxhkdrc; do
diff -u $fixtures/sample.$format $samples/$format.sample
done
cd $fixtures
for file in $(ls | sort); do
echo "== $file"
${komorebic}/bin/komorebic hotkeys compile --mode auto --dry-run "$file" --output shortcuts 2>&1
echo
done > $TMPDIR/got
diff -u $expected $TMPDIR/got
echo "$(ls $fixtures | wc -l) files plan as expected"
touch $out
''