Dmerge - A mini-DSL for Data

Initial Release: 0.1.0
From the Readme:

Dmerge

A mini merge DSL for data overlays.

Dmerge is a lightweight alternative to the NixOS module system to wrangle data. It aims to give you alternative semantics, currently not available in the ecosystem, when you need them.

So, if you’re one of those who sometimes needs different semantics, I hope this is useful.

Some use cases:

  • De-risk configuration management of Deployment Manifests and their specializations through its monotonicity on the data spine
  • When the module system is too complex to adopt
  • When you want to mix and match plain data files in various formats (yaml, toml, json, …)
  • When you don’t control a data source but want to work with it as if it was just Nix
Party with the Masters
# nix repl
> WithMichi = chainable {michelangelo = { age = 548; };}
> WithRemi = chainable {rembrandt = { age = 417; };}
> WithLeo = chainable {davinci = { age = 571; };}
> mkParty = chainMerge
> :p mkParty WithMichi WithRemi WithLeo {me = {age = 35;};}
{ davinci = { age = 571; }; me = { age = 35; }; michelangelo = { age = 548; }; rembrandt = { age = 417; }; }
1 Like

0.2.0 - 2023-05-15

Documentation

Features

Miscellaneous Chores

Refactoring


Highlight

feat: allow fresh rhs with prepend/append

This is useful if the lhs has optional values that may or may not be
present.

This feature allows keeping simple wrapper functions more semantic:

{foo ? {}, qux, zep ? []}: f foo // {
  bar = foo ? bar or {} // (qux // {zep = zep ++ (foo.bar.zep or [])});
};

{foo ? {}, qux, zep}: f (merge foo {
  bar = merge (qux {zep = prepend zep;});
})

0.2.1 - 2023-06-15

Bug Fixes

Documentation

Miscellaneous Chores

1 Like