Make combinators available at jail.combinators

Instead of requiring the third argument to be a function that passes in
combinators, this exposes all combinators on `jail.combinators` and
allows the third argument to just be a list (or even null!). This may be
more ergonomic in some contexts (like nixpkgs overlays).

This isn't a breaking change, the third argument can still be a function
and will receive the combinators if it is.
This commit is contained in:
Alex David 2025-07-11 11:44:12 -07:00
commit c5ba72dc5a
4 changed files with 110 additions and 98 deletions

View file

@ -1,16 +1,10 @@
{
outputs = _: {
lib = let
runJail = import ./lib.nix;
jailLib = import ./lib.nix;
in {
init = pkgs: name: exe: applyCombinators: runJail {
inherit pkgs name exe applyCombinators;
};
extend = { pkgs, additionalCombinators }: name: exe: applyCombinators: runJail {
inherit pkgs name exe;
applyCombinators = combinators: applyCombinators (combinators // additionalCombinators combinators);
};
init = pkgs: jailLib { inherit pkgs; };
extend = jailLib;
};
};
}