build: route the workspace to crates/

The workspace members, the path dependencies, the include_str! and test
fixture paths, the recorder's indexed source keys, and the Nix source
filter and path literals follow the new layout. Cargo.lock is unchanged.
This commit is contained in:
LGUG2Z committed 2026-11-05 15:03:27 -08:00
1 parent 6def6bdfbf
commit 259575a1b3
38 files changed
+159 -158

No files matched your search

+3 -3
View File
@@ -135,7 +135,7 @@ in
# the Linux packages and the platform-neutral crates (layouts, scrolling, themes and the
# shared crates/*), whose tests ran in no check. Not `--workspace`: that unifies the
# features of komorebi-daemon and the crates it pulls in, and windows-future fails to build.
# features of komorebi and the crates it pulls in, and windows-future fails to build.
linux-nextest = build.craneLib.cargoNextest (
build.individualCrateArgs
// {
@@ -169,8 +169,8 @@ in
pkgs.typescript
];
src = lib.fileset.toSource {
root = ../../komorebi-linux/src/kwin;
fileset = lib.fileset.fileFilter (file: !file.hasExt "rs") ../../komorebi-linux/src/kwin;
root = ../../crates/komorebi-linux/src/kwin;
fileset = lib.fileset.fileFilter (file: !file.hasExt "rs") ../../crates/komorebi-linux/src/kwin;
};
}
''
+4 -4
View File
@@ -8,9 +8,9 @@
"crates/komorebi-transport",
"crates/komorebi-version",
"crates/komorebic-core",
"komorebi-client",
"komorebi-layouts",
"komorebi-scrolling",
"komorebi-themes",
"crates/komorebi-client",
"crates/komorebi-layouts",
"crates/komorebi-scrolling",
"crates/komorebi-themes",
"komorebic"
]
+2 -2
View File
@@ -1,5 +1,5 @@
# `keybindings-fixtures`: every key binding file of the fixture corpus
# (komorebi-hotkeys/tests/fixtures) through `komorebic hotkeys compile --mode auto --dry-run`,
# (crates/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,
@@ -15,7 +15,7 @@ let
in
pkgs.runCommand "keybindings-fixtures"
{
fixtures = ../../../komorebi-hotkeys/tests/fixtures;
fixtures = ../../../crates/komorebi-hotkeys/tests/fixtures;
expected = ./keybindings.expected;
samples = lib.fileset.toSource {
root = ../../../docs/linux;
+2 -2
View File
@@ -344,13 +344,13 @@ let
withFile = keybindings {
format = "sxhkd";
file = ../../../komorebi-hotkeys/tests/fixtures/plain.sxhkdrc;
file = ../../../crates/komorebi-hotkeys/tests/fixtures/plain.sxhkdrc;
};
textAndFile = keybindings {
format = "skhd";
text = "alt - h : komorebic focus left\n";
file = ../../../komorebi-hotkeys/tests/fixtures/plain.skhdrc;
file = ../../../crates/komorebi-hotkeys/tests/fixtures/plain.skhdrc;
};
# the typed `config` and the key bindings are two parts of one command line
+1 -1
View File
@@ -1,5 +1,5 @@
# vm-keys-skhd, vm-keys-whkd and vm-keys-sxhkd: the case `vm` of the key binding corpus
# (komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module
# (crates/komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module
# (`services.komorebi.keybindings`, mode auto). Alt+J can be a static shortcut, which KWin runs
# from the system profile; Alt+, cannot, so the module's daemon registers it and runs it. The Rust
# tests and `keybindings-fixtures` check the plan; only a real session can say that what the
@@ -1,5 +1,5 @@
r"""vm-keys-skhd, vm-keys-whkd and vm-keys-sxhkd: the case `vm` of the key binding corpus
(komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module
(crates/komorebi-hotkeys/tests/fixtures/vm.*), in the format of the suite, installed by the NixOS module
(`services.komorebi.keybindings`, mode auto). Alt+J can be a static shortcut, which KWin runs
from the system profile; Alt+, cannot, so the module's daemon registers it and runs it. The Rust
tests and `keybindings-fixtures` check the plan; only a real session can say that what the
@@ -6,7 +6,7 @@
script = "../../keys-corpus.py";
node.services.komorebi.keybindings = {
format = "skhd";
file = ../../../../../../komorebi-hotkeys/tests/fixtures/vm.skhdrc;
file = ../../../../../../crates/komorebi-hotkeys/tests/fixtures/vm.skhdrc;
mode = "auto";
};
}
@@ -6,7 +6,7 @@
script = "../../keys-corpus.py";
node.services.komorebi.keybindings = {
format = "sxhkd";
file = ../../../../../../komorebi-hotkeys/tests/fixtures/vm.sxhkdrc;
file = ../../../../../../crates/komorebi-hotkeys/tests/fixtures/vm.sxhkdrc;
mode = "auto";
};
}
@@ -6,7 +6,7 @@
script = "../../keys-corpus.py";
node.services.komorebi.keybindings = {
format = "whkd";
file = ../../../../../../komorebi-hotkeys/tests/fixtures/vm.whkdrc;
file = ../../../../../../crates/komorebi-hotkeys/tests/fixtures/vm.whkdrc;
mode = "auto";
};
}
+27 -27
View File
@@ -38,14 +38,24 @@ let
# kept equal to `cargo tree` by tools/kde-closure-check); komorebi-bar and komorebi-bar-core (the egui
# bar) are not in it, so an edit of the bar does not rebuild the KDE packages
linuxShared = builtins.fromJSON (builtins.readFile ./linux/root-crates.json) ++ [
"komorebi-daemon"
"komorebi"
];
# the crates only one platform builds; the Windows set also has the e2e guests and the Windows-only
# binaries, which the other platforms never build
linuxOnly = [
"komorebi-linux"
"komorebi-hotkeys"
"crates/komorebi-linux"
"crates/komorebi-hotkeys"
];
macosOnly = [ "crates/komorebi-macos" ];
windowsOnly = [
"crates/komorebi-windows"
"crates/komorebi-e2e-agent"
"crates/komorebi-testwin"
"komorebi-gui"
"komorebic-no-console"
"komorebi-shortcuts"
];
macosOnly = [ "komorebi-macos" ];
# the development tool that writes the Nix options: built by its own checks (nix/nixgen)
toolOnly = [ "crates/schemars-nixgen" ];
@@ -53,11 +63,11 @@ let
# the recorder and the crates whose source its build script indexes (komorebi-recorder/build.rs)
recorderMembers = [
"komorebi-recorder"
"komorebi-windows"
"komorebi-macos"
"komorebi-linux"
"komorebi-client"
"komorebi-layouts"
"crates/komorebi-windows"
"crates/komorebi-macos"
"crates/komorebi-linux"
"crates/komorebi-client"
"crates/komorebi-layouts"
"crates/komorebi-core"
"crates/komorebi-transport"
];
@@ -65,21 +75,13 @@ let
membersOf = {
recorder = recorderMembers;
nixgen = toolOnly;
# everything but the other two platforms' daemons and the tool
# everything but the other two platforms' crates and the tool
windows = builtins.filter (m: !(builtins.elem m (linuxOnly ++ macosOnly ++ toolOnly))) allMembers;
linux = linuxOnly ++ linuxShared;
macos =
macosOnly
++ [
"komorebic"
"komorebi-client"
"komorebi-bar"
"komorebi-daemon"
"komorebi-layouts"
"komorebi-scrolling"
"komorebi-themes"
]
++ builtins.filter (m: lib.hasPrefix "crates/" m && !(builtins.elem m toolOnly)) allMembers;
# everything but the Windows and Linux crates, the tool and the recorder
macos = builtins.filter (
m: !(builtins.elem m (windowsOnly ++ linuxOnly ++ toolOnly ++ [ "komorebi-recorder" ]))
) allMembers;
};
members = builtins.filter (m: builtins.elem m membersOf.${platform}) allMembers;
@@ -92,9 +94,9 @@ let
# tests (named by prefix) and drops the other platforms'
sharedCrates = [
"komorebic"
"komorebi-client"
"crates/komorebi-client"
"komorebi-bar"
"komorebi-daemon"
"komorebi"
];
markers = {
windows = "(src/windows(\\.rs|/.*)|tests/windows_.*)";
@@ -158,7 +160,6 @@ let
)
|| lib.hasPrefix "docs/macos/cli/" rel
|| lib.hasPrefix "schemas/" rel
|| lib.hasPrefix "komorebic/fixtures/" rel
# the icon and the guide the recorder embeds, and the installer a test of it reads
|| lib.hasPrefix "komorebi-recorder/" rel
|| lib.hasPrefix "wix/" rel;
@@ -183,8 +184,7 @@ let
macos =
lib.hasSuffix ".json" rel && !(lib.hasPrefix "docs/" rel || lib.hasPrefix "schemas/" rel)
|| lib.hasPrefix "docs/macos/" rel
|| lib.hasPrefix "schemas/macos/" rel
|| lib.hasPrefix "komorebic/fixtures/" rel;
|| lib.hasPrefix "schemas/macos/" rel;
# the guide and the icon the recorder embeds, and the installer
recorder = lib.hasPrefix "komorebi-recorder/" rel || lib.hasPrefix "wix/" rel;
nixgen = false;