Commit Graph
16 Commits
Author SHA1 Message Date
LGUG2Z b15d7cdc53 build(nix): import the nested flakes instead of locking them as inputs
The root flake got the code of komorebi-for-kde and komorebi-for-mac through two locked path inputs (kfde, kfm), so the root flake.lock pinned the content of those directories and needed 'nix flake update kfde kfm' after any edit under them; a stale pin gave 'attribute lib missing'.

Now the root imports komorebi-for-kde/flake.nix and komorebi-for-mac/flake.nix as plain files and calls their outputs/lib.mkOutputs with inputs declared in the root under the names kfde-* and kfm-* (nixpkgs, nixpkgs-lib, flake-compat, flake-parts, crane, rust-overlay, treefmt-nix, git-hooks-nix, and gitignore for kfm), pinned by revision in the URL to exactly the revisions of each nested flake.lock, with the same follows structure. The nested flakes are unchanged and still have their own locks. The kfde and kfm nodes are gone from flake.lock. When a nested flake.lock is bumped, update the revisions of the matching kfde-*/kfm-* inputs by hand.

Verified (tier 2): derivation paths unchanged before and after for kfde fmt, deny, nextest, schema-fresh, the Windows workspace clippy check, kfde-komorebic and kfm-komorebic (aarch64-darwin, eval only); every narHash of the nested locks is present in the root lock; nix flake check --no-build passes on x86_64-linux; nixosModules, overlays, darwinModules evaluate; kfde-vm has 34 suites.
2026-10-31 01:37:53 -07:00
LGUG2Z 74433e30bc build(nix): build the KDE and macOS packages from the whole repository
The root flake no longer re-exports the nested flakes' own outputs. It keeps them as inputs for their pinned nixpkgs, crane and rust-overlay (inputs.<name>.inputs), but calls their lib.mkOutputs with the whole repository (self) as the source, a nested self carrying the root rev, dirtyRev and inputs, and the tree's directory, then re-exports packages, checks (without vm-*), legacyPackages.kfde-vm, nixosModules, overlays and darwinModules from those. flake.lock is updated for the changed nested flakes: the lock pins their content, so it needs 'nix flake update kfde kfm' whenever a file under komorebi-for-kde or komorebi-for-mac changes.

Verified (Linux, x86_64): nix build -L of packages.kfde-komorebic and kfde-komorebi succeed and both binaries run with --help (exit 0); checks kfde-schema-fresh, nix-options-validation, keybindings-fixtures, komorebi-bridge-js, nixos-module-eval, plasma-guests-eval, run-kde-dry-run, run-kde-doctor, komorebi-workspace-fmt, -deny and -nextest build; kfde-komorebi-workspace-toml-fmt FAILS because komorebi-for-kde/Cargo.toml itself is not taplo-formatted (same result running taplo on the file directly; not caused by this change). nix eval of aarch64-darwin kfm-komorebic and kfm-komorebi drvPath print .drv paths (evaluated, not built). Windows clippy and default drvPaths are identical to those before this revision. nix flake check --no-build passes for x86_64-linux. Not verified: any darwin build, kfde clippy/doc, the VM suites.
2026-10-31 01:37:53 -07:00
LGUG2Z a57ca82f0c fix(nix): do not require dirtyRev in the root flake
A path flake (a jj workspace without .git) has neither rev nor dirtyRev, so the commit stamp default in mkKomorebiPackages failed to evaluate. It now falls back to "unknown", as the nested flakes do.

Verified: nix eval --raw .#checks.x86_64-linux.komorebi-workspace-clippy.drvPath now prints z9nb5j12qlfp1j8d71ykp9qnafk553ra-komorebi-workspace-clippy-0.1.0.drv (it failed before); .#packages.x86_64-linux.default.drvPath is cq0i40300hgsm0ih2llcdjpkcg9sfqaf-komorebi-workspace-0.1.0.drv. Neither was built.
2026-10-31 01:37:53 -07:00
LGUG2Z c155917d71 build(nix): re-export the KDE and macOS flakes from the root flake
Phase 1 of A3b. The root flake imports the nested flakes' lib.mkOutputs with the whole repository as source and re-exports packages, checks (without vm-*), nixosModules, overlays and darwinModules with kfde-/kfm- prefixes. Windows outputs are untouched. Verified: the KDE package builds; the macOS package evaluates (not built).
2026-10-31 01:37:53 -07:00
LGUG2Z 2e78aa69df build(nix): keep the other platforms' trees out of the Windows build source
Excludes /komorebi-for-kde and /komorebi-for-mac from the Windows crane source filter so their edits do not invalidate Windows builds and their Cargo.lock files are not swept in. Verified: the Windows clippy check still passes.
2026-10-31 01:37:53 -07:00
LGUG2Z 4712ea3e96 fix(nix): include the pan transcript fixtures in the build source
komorebi/src/pan.rs and komorebic/src/pan.rs include_str! the .txt files in komorebic/fixtures/, which the crane source filter dropped, so the nix build failed. Adds the fixtures to the filter. Verified: nix komorebi-workspace-clippy passes.
2026-10-31 01:37:53 -07:00
LGUG2Z 725c95ffc2 feat(nix): OpenSSL for the host build script in the devshell
komorebic's build script (reqwest) runs on the build host and needs
pkg-config and OpenSSL, as in the nix build, so cargo test --workspace works
from nix develop.
2026-10-30 18:22:45 -07:00
LGUG2Z b1d053b358 perf(nix): build the test window with the constant stamp too
komorebi-testwin-e2e is the e2e build's test window, so a change to it
rebuilds the crate and not its dependencies (86 s instead of minutes);
build-ref.sh uses it.
2026-10-30 18:22:45 -07:00
LGUG2Z 2d830fed8a test(nix): run the e2e tests in nix flake check
The vendored core's tests and those of the runner, which need no guest.
2026-10-30 18:22:44 -07:00
LGUG2Z be4f1707ab perf(nix): build the e2e binaries with a constant commit stamp
COMMIT_HASH is in the derivation of the dependencies too, so every commit
rebuilt everything for nix run .#e2e-windows. The e2e build stamps e2e;
the commit under test is KOMOREBI_E2E_COMMIT.
2026-10-30 18:22:44 -07:00
LGUG2Z 07ef8e93d6 feat(nix): put the e2e guest tools in the devshell
qemu, swtpm, xorriso, socat, git, python with pillow and pytest, OVMF_FD
and PYTHONPATH, so the build scripts and the runner work from nix develop.
2026-10-30 18:22:44 -07:00
LGUG2Z 5840f36e1c feat(e2e): build the golden image in two layers
build-base.sh does the unattended install (about 18 minutes) and
build-golden.sh puts policies, Defender and the display driver on top of
it in about 2.5 minutes through the guest agent (provision.ps1). A qcow2
chain with a relative backing path keeps the two together.

build-ref.sh builds komorebi and komorebic of any commit, and
KOMOREBI_E2E_BINS makes nix run .#e2e-windows test those binaries.
2026-10-30 18:22:44 -07:00
LGUG2Z 7c59f3e2c6 feat(nix): run the Windows e2e scenarios with nix run .#e2e-windows
E2E_GOLDEN names the golden image built by build-golden.sh; the komorebi,
komorebic and test window binaries, QEMU, swtpm and an OVMF with TPM support
come from the flake. Also exposes the guest agent and the test window as
packages.
2026-10-30 18:22:44 -07:00
LGUG2Z 3ae77df287 fix(nix): build the Windows SDK the same on every host
xwin makes case-alias symlinks on a case-sensitive filesystem and none on a
case-insensitive one, so the SDK hash depended on the host. Build with
--disable-symlinks, pin that tree's hash, add the CA bundle xwin needs, and
add the lowercase aliases the linker asks for in a separate derivation.
2026-10-30 18:22:44 -07:00
LGUG2Z 21a821aca0 fix(nix): get the build working again 2026-10-28 19:30:00 -07:00
LGUG2Z 6e36b81669 build(nix): add flake.nix for cross-compilation from darwin and linux
I was getting really tired of having to switch between display inputs to
different platform-specific machines to be able to make and test changes
on komorebi for Windows and komorebi for Mac.

With this commit, the `flake.nix` provides a Nix devShell and crane
build for users to make and validate changes with `cargo check`, `cargo
clippy` and `cargo build` with the Windows MSVC toolchain on Linux and
macOS.
2025-12-28 17:24:41 -08:00