Files
komorebi/nix/linux/tests/keybindings.nix
T
LGUG2Z f01853ceca refactor(repo): move the KDE and macOS nix files under nix/ (pure move)
komorebi-for-kde/nix/ -> nix/linux/
komorebi-for-mac/nix/ -> nix/macos/

The nix expressions of the platforms (modules, option files, VM test suites, kwin effects,
the darwin module) sit next to the existing nix/workspace-src.nix. Renames only (252
files); the flakes that import them are replaced by one root flake later in this stack, so
nix does not evaluate at this revision.
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;
fileset = lib.fileset.fileFilter (file: file.hasExt "sample") ../../docs;
};
}
''
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
''