Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atom-nix: cfg as json api #48

Open
3 tasks
nrdxp opened this issue Dec 22, 2024 · 0 comments
Open
3 tasks

atom-nix: cfg as json api #48

nrdxp opened this issue Dec 22, 2024 · 0 comments

Comments

@nrdxp
Copy link
Member

nrdxp commented Dec 22, 2024

Implement the Nix-side configuration input mechanism, establishing a typed JSON interface for receiving client-side configuration into the atom-nix evaluation context.

Design

The cfg scope will:

  • Receive pre-validated JSON configuration via a well-defined schema
  • Expose configuration values to the module scope
  • Support both static values and dynamically generated content by accepting any JSON that validates against the schema (e.g. build matrices)
  • Provide a clean interface for external tools to inject configuration before evaluation

Implementation

  1. Introduce cfg scope at the top-level
  2. Define JSON schema that specifies:
    • Valid configuration structure
    • Type constraints
    • Required vs optional fields
  3. Implement JSON ingestion and exposure to module system

Technical Benefits

Input Boundary

  • Creates clear interface for external configuration injection
  • Moves type checking responsibility to client side, eliminating complex validation logic from Nix evaluation context
  • Enables clean HTTP API integration for remote evaluation via pre-validated JSON, leveraging pervasive JSON schema and web API library support across ecosystems

Architecture

  • Separates configuration concerns from evaluation logic
  • Provides typed interface without the debugging complexity inherent to Nix-based validation
  • Establishes foundation for plugin-based schema extensions
  • Supports optimization of evaluation scheduling through clean configuration boundaries

Deliverables

  • Initial cfg scope implementation with JSON ingestion
  • Base schema definition for atomic dependency management and fundamental configuration
  • Consider an interface to extend Base
@nrdxp nrdxp changed the title cfg as json api atom-nix: cfg as json api Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant