diff --git a/README.md b/README.md index 1cc47a1..c15bbf7 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ A helper to make it easy and ergonomic to wrap your derivations in ls -la $HOME ''; in { - packages.x86_64-linux.jailed = jail "my-jail" untrusted-package (h: with h; [ + packages.x86_64-linux.jailed = jail "my-jail" untrusted-package (combinators: with combinators; [ # By default, only the bare minimum permissions are exposed, in this list # you can add additional permissions that you want the program to have. - # See ./helpers.nix for more functions that can go here + # See ./combinators.nix for more functions that can go here # Give program access to the network network diff --git a/helpers.nix b/combinators.nix similarity index 100% rename from helpers.nix rename to combinators.nix diff --git a/flake.nix b/flake.nix index 97b9601..1c0488b 100644 --- a/flake.nix +++ b/flake.nix @@ -7,9 +7,9 @@ inherit pkgs name exe getOpts; }; - extend = { pkgs, additionalHelpers }: name: exe: getOpts: runJail { + extend = { pkgs, additionalCombinators }: name: exe: getOpts: runJail { inherit pkgs name exe; - getOpts = helpers: getOpts (helpers // additionalHelpers helpers); + getOpts = combinators: getOpts (combinators // additionalCombinators combinators); }; }; }; diff --git a/lib.nix b/lib.nix index 06bb489..d58c08d 100644 --- a/lib.nix +++ b/lib.nix @@ -3,7 +3,7 @@ exe-str = if builtins.typeOf exe == "string" then lib.escapeShellArg exe else lib.getExe exe; - jail-helpers = import ./helpers.nix pkgs; + combinators = import ./combinators.nix pkgs; initial-state = lib.pipe { cmd = "${lib.getExe pkgs.bubblewrap}"; @@ -13,7 +13,7 @@ new-session = true; hostname = "jail"; env = {}; - } (with jail-helpers; [ + } (with combinators; [ (unsafe-add-raw-args "--proc /proc") (unsafe-add-raw-args "--dev /dev") (unsafe-add-raw-args "--tmpfs /tmp") @@ -35,13 +35,13 @@ '') (unsafe-add-raw-args "--ro-bind ~/.local/share/jails/passwd /etc/passwd") ]); -in lib.pipe jail-helpers [ +in lib.pipe combinators [ # collect opts getOpts (lib.foldl (acc: el: el acc) initial-state) # finalize state - (with jail-helpers; compose [ + (with combinators; compose [ (s: set-env "PATH" s.path s) (s: if s.new-session then unsafe-add-raw-args "--new-session" s else s) (s: lib.foldr (envVar: