Module manifest

Source
Expand description

§Atom Manifest

This module provides the core types for working with an Atom’s manifest format. The manifest is a TOML file that describes an atom’s metadata and dependencies.

§Manifest Structure

Every atom must have a manifest file named atom.toml that contains at minimum a [package] section with the atom’s label, version, and optional description. Additional sections can specify package sets and dependencies.

§Package Sets and Mirrors

The [package.sets] table defines named sources for atom dependencies. Each set can be a single URL or an array of mirror URLs. The special value "::" represents the local repository and enables efficient development workflows by allowing atoms to reference each other without requiring eka publish after every change.

This mirrors the URI format where ::<atom-name> indicates a local atom from the current repository (as opposed to remote atoms which would be prefixed with a URL or alias).

§Key Types

  • Manifest - The complete manifest structure, representing the atom.toml file.
  • Atom - The core atom metadata (label, version, description, sets).
  • Dependency - Atom and direct Nix dependencies (see deps module).
  • AtomError - Errors that can occur during manifest processing.

§Example Manifest

[package]
label = "my-atom"
version = "1.0.0"
description = "A sample atom for demonstration"

[package.sets]
company-atoms = "git@github.com:our-company/atoms"
local-atoms = "::"

[deps.from.company-atoms]
other-atom = "^1.0.0"

[deps.direct.nix]
external-lib.url = "https://example.com/lib.tar.gz"

§Validation

Manifests are strictly validated to ensure they contain all required fields and have valid data. The #[serde(deny_unknown_fields)] attribute ensures that only known fields are accepted, preventing typos and invalid configurations.

§Usage

Manifests can be created programmatically or parsed from a string or file.

use std::str::FromStr;

use atom::manifest::Manifest;
use atom::{Atom, Label};
use semver::Version;

// Create a manifest programmatically.
let manifest = Manifest::new(
    Label::try_from("my-atom").unwrap(),
    Version::new(1, 0, 0),
    Some("My first atom".to_string()),
);

// Parse a manifest from a string.
let manifest_str = r#"
[atom]
label = "parsed-atom"
version = "2.0.0"
"#;
let parsed = Manifest::from_str(manifest_str).unwrap();

Modules§

deps
Atom Dependency Handling
sets 🔒

Structs§

AtomMap 🔒
EkalaManager
A writer to assist with writing into the Ekala manifest.
EkalaManifest
The entrypoint for an ekala manifest describing a set of atoms.
EkalaSet
The section of the manifest describing the Ekala set of atoms.
Manifest
Represents the structure of an atom.toml manifest file.
MetaData 🔒

Enums§

AtomError
An error that can occur when parsing or handling an atom manifest.
AtomSet
Represents the possible values for a named atom set in the manifest.
SetMirror
A strongly-typed representation of a source for an atom set.

Functions§

find_upwards 🔒
Returns the directory of the searched file and a path to the file itself as a tuple.

Type Aliases§

AtomResult
A specialized result type for manifest operations.