No description
Replace python3.withPackages environments with direct pythonPackages references in writePython3 (the former is not a valid `libraries` value). Add doCheck = false across all Python modules to skip pycodestyle enforcement. Add test-http thread exercising the http/http-request module end-to-end. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| envs | ||
| modules | ||
| test_threads | ||
| threads | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
moira-modules
Standard library for moira — reusable environments, typed modules, and reference threads.
What's here
| Directory | Contents |
|---|---|
envs/ |
Nix shell environments for common toolchains |
modules/ |
Typed, reusable step implementations |
threads/ |
Ready-to-use pipeline definitions |
Import
# flake.nix
inputs.moira-modules.url = "git+https://git.hydrar.de/jmarya/moira-modules";
inputs.moira-modules.inputs.nixpkgs.follows = "nixpkgs";
Inside your outputs, bind moiraModules and moiraEnvironments per system:
outputs = { self, nixpkgs, moira-modules, ... }:
flake-utils.lib.eachDefaultSystem (system: {
moiraPipelines = {
ci = moira-modules.moiraPipelines.${system}.ci; # use a reference thread
};
});
Or reference them directly in thread files:
# threads/deploy.nix
{ moiraModules, moiraEnvironments, ... }:
{
name = "deploy";
trigger.on_push.branches = [ "main" ];
env = moiraEnvironments.rust;
steps = [
{ name = "test"; run = "cargo test --workspace"; }
{ name = "build"; run = "cargo build --release"; depends_on = [ "test" ]; }
{
name = "notify";
use = moiraModules."http/http-request";
"with" = {
method = "POST";
url = "https://hooks.example.com/deploy";
body_json = { sha = "${{ git.sha }}"; status = "ok"; };
};
depends_on = [ "build" ];
}
];
}
Environments
| Name | Provides |
|---|---|
rust |
cargo rustc clippy rustfmt pkg-config openssl |
node |
nodejs npm |
python |
python3 pip virtualenv |
go |
go gopls gotools |
docker |
docker docker-compose |
Set on a thread (all steps share it) or on an individual step to override.
Modules
| Module | What it does |
|---|---|
http/http-request |
HTTP requests — GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
git/git |
Git operations — clone, commit, push, pull, tag, branch, merge |
ssh/ssh |
Execute commands or transfer files over SSH |
s3/s3 |
S3-compatible storage — ls, cp, sync, presign, … (AWS, MinIO, R2) |
compression/compress |
Compress and extract tar, gz, bz2, xz, zip |
crypto/crypto |
Hash, HMAC, sign, verify, key generation |
jwt/jwt |
Sign, verify, and decode JWTs (HS*, RS*, ES*, EdDSA) |
totp/totp |
Generate and verify TOTP tokens |
Modules have a typed interface — declared inputs and outputs. Inputs are passed via with; outputs are available in downstream steps as ${{ steps.NAME.outputs.KEY }}. Secret inputs take a secret name, not the value — the agent fetches and injects it at runtime.
See also
- moira — the engine that runs these
- moira docs → Modules — full module interface spec and built-in modules
- moira docs → Environments — injected env vars and step environment model