mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-20 15:41:38 +01:00
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.
39 lines
1.4 KiB
Nix
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
|
|
''
|