urbit/nix/cachix/util.nix
benjamin-tlon ade1e59ce1
Get cross-compilation ready for release. (#1263)
* Add cross-compilation for `lmdb`.
* Got built caching working in CI with `cachix`.
* Cache cross compilation dependencies and toolchains.
* Do release builds in CI.
* Upload release builds to `bootstrap.urbit.org` on successful build.
* Lots of optimization work for CI.
* Boot from a solid pill in CI and load arvo with `-A`.
* Increase `vere` HTTP timeout to 15m.
2019-05-02 13:13:48 -07:00

27 lines
691 B
Nix

# Some utility functions:
rec {
# The inverse of builtins.listToAttrs
attrsToList = o:
map (a: { name=a; value=builtins.getAttr a o; })
(builtins.attrNames o);
# ∀o,x,y. produce o' such that o'.y == o.x.y (assuming no conflicts)
flattenSet = o:
builtins.foldl' (acc: v: acc // v) {}
(builtins.attrValues o);
prefixSetAttrs = prefix: o:
builtins.listToAttrs
(map ({name, value}: { name=prefix + name; value=value; })
(attrsToList o));
# ∀o,x,y. produce o' such that o'.x-y == o.x.y
flattenSetPrefix = o:
(builtins.foldl' (acc: o: acc // o) {}
(map ({name, value}: prefixSetAttrs name value)
(attrsToList o)));
}