-
Notifications
You must be signed in to change notification settings - Fork 0
Tracking Issue: A Usable First Iteration of the eka CLI #25
Description
Summary
This issue tracks the work required to implement a usable first iteration of the eka command-line interface. The goal is to create a user-friendly CLI that leverages the snix ecosystem for a more robust and decoupled store management, sandboxed execution, and a simple configuration interface. This work builds upon the proof-of-concept in the nixec crate and aligns with the "Evaluation & Execution" goals outlined in the project roadmap.
Core Architecture
The proposed architecture is as follows:
-
snixContent-Addressed Store (castore): We will use asnixcastore as the fundamental Nix store for allekaoperations. This provides superior caching and garbage collection properties compared to the legacy Nix store and includes a compatibility layer for legacy Nix calls. -
Sandboxed Environment: All build and evaluation operations will occur within a sandbox. A
snixblob-store will be mounted at/nix/storewithin this sandbox at runtime. We will usesnix'snix-daemonto pass store paths to this mounted store. This approach has the significant benefit of not requiring users to have a system-wide, root-owned/nix/store, as the blob-store can reside in any user-writable location. -
eka-runShebang: For executing binaries that depend on/nix/storepaths, we will introduce aneka-runshebang. Similar in spirit tonix-shell, this wrapper will first initialize the sandboxed store over the current working directory before executing the binary, ensuring its dependencies are available.
This architecture provides the isolation of flakes without the overhead, decouples eka from a system-wide Nix installation, and improves the overall usability and caching story.
MVP Scope
-
Sandboxing & Execution:
- Implement a sandbox that mounts a user-defined
snixblob-store to/nix/store. - Integrate with
snix'snix-daemonto manage store path resolutions. - Develop the
eka-runshebang wrapper to execute binaries within the sandboxed context.
- Implement a sandbox that mounts a user-defined
-
User Entrypoint &
atom-nixIntegration:- Design and implement a basic user entrypoint for invoking atom evaluations.
- Define a clear interface for passing configuration from
ekainto theatom-nixevaluation.
Future Work
-
snixStore Integration:- Use a
snixcastore as the primary store for allekaoperations. - Leverage the
snixcompatibility layer to ensure legacynixcalls function correctly.
- Use a
-
User Entrypoint &
atom-nixIntegration:- Ensure the interface is generic enough to support alternative Nix layouts in the future.
- Normalize (e.g., to canonical JSON) and hash the passed configuration to tie the final artifact's integrity cryptographically to the atom's ID, version, and configuration.
-
Generic Evaluator & Builder Interface:
- Design a trait-based interface for the evaluator and builder.
- Implement the initial version using legacy
nixas the backend. - Ensure the interface is flexible enough to support future backends like
snixwith minimal effort.
-
Configuration API:
- Implement a configuration API to parse
atom.toml. - Allow passing in system variables for features like cross-compilation.
- Allow users to specify configurable variations that can be invoked at the CLI boundary.
- Implement a configuration API to parse
-
Core Commands:
- Implement the
eka resolvecommand to synchronize the lock file with the manifest. (largely done by the work foreka add) - Scaffold other necessary commands to invoke this runtime.
- Implement the