Skip to content

atom-nix: cfg as json api #48

@nrdxp

Description

@nrdxp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions