A reusable Nickel contract library that enforces Rhodium Standard Repository (RSR) policies at configuration time. Part of the nickel-augmentation monorepo.
Nickel-augmented provides typed, validated configuration contracts for RSR-compliant projects. Import the library into your .ncl files to get compile-time enforcement of:
-
Language policy — only RSR-allowed languages pass validation
-
License policy — SPDX identifiers restricted to approved set
-
Security policy — HTTPS-only URLs, SHA-256+ hashes, SHA-pinned actions
-
Infrastructure contracts — services, databases, containers, environments
-
CI/CD contracts — job definitions, matrix builds, workflow steps
# Import the full library
let aug = import "./lib/prelude.ncl" in
{
project = {
name | aug.rsr.NonEmptyString = "my-project",
version | aug.rsr.SemVer = "1.0.0",
license | aug.rsr.SpdxLicense = "MPL-2.0",
},
api | aug.infra.Service = {
name = "api-gateway",
port = 8080,
health_check = "/health",
environment = "production",
replicas = 3,
},
}Or import individual modules:
let rsr = import "./lib/rsr.ncl" in
let security = import "./lib/security.ncl" in
{
target | rsr.BuildTarget = {
name = "backend",
language = "gleam", # ← passes AllowedLanguage contract
entry_point = "src/app.gleam",
},
db_password | security.SecretRef = {
type = 'vault,
key = "secret/prod/db-password",
},
}| Module | Contracts | Purpose |
|---|---|---|
|
|
Core RSR policy enforcement |
|
|
Security policy contracts |
|
|
CI/CD workflow contracts and templates |
|
|
Infrastructure and deployment contracts |
|
Re-exports |
Convenience import for all modules |
Nickel augments RSR templates — it does not replace other tools:
| Nickel handles | Stays in | Reason |
|---|---|---|
Build config, CI pipelines, infra |
— |
Contracts validate at build-time |
— |
|
Guile Scheme governs project state |
— |
|
Native package managers |
— |
Runtime config |
Environment variables / JSON at runtime |
— |
Application logic |
ReScript / Rust / Gleam |
Rule: Nickel generates, Scheme governs. Contracts, not code.
See examples/nickel/ for working examples:
-
contracts.ncl— Shared contracts (standalone version of the library) -
build.ncl— Build targets with language policy enforcement -
ci.ncl— CI/CD pipeline with merge semantics -
infra.ncl— Infrastructure config with secret references
# Typecheck all library modules
nickel typecheck lib/rsr.ncl
nickel typecheck lib/security.ncl
nickel typecheck lib/ci.ncl
nickel typecheck lib/infra.ncl
# Typecheck examples
nickel typecheck examples/nickel/build.ncl
# Export a config to JSON
nickel export examples/nickel/build.ncl