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:
parent
2f6e7c3078
commit
c5ba72dc5a
4 changed files with 110 additions and 98 deletions
12
flake.nix
12
flake.nix
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue