queer/boxxy

Configuration via cli args

asciimoth opened this issue ยท 6 comments

Boxxy is not so convenient to use inside pipelines and call from other programs because it loads the configuration from a hardcoded path.
It would be much more convenient if the path to the config could be specified via optional cli argument.
It would also be convenient if the rules could be passed directly through arguments, without using a config at all.

I second this. Was trying to make a boxxy build-time hook for nix packages.
Bwrap is not that flexible.

queer commented

Hi! I'm open to adding this for sure. I'm okay with both options; in my head they look something like:

  1. Adding custom config files with -c .../--config ...
  2. Passing rules via CLI flag, smth like -r/--rule "/remount/this:/to/this:<file/dir>", ex. boxxy -r /usr/bin:/my/usr/bin:dir or boxxy -r "/usr/bin/echo:/my/usr/bin/echo:file"

If that sounds usable-enough then I'm happy to get this in; I'm uncertain how nicely other rule-specific things like context/only will play with CLI flags, but that might be a thing for down the road if this sort of rule flag would be good enough for now.

For me personally, either would work. Thanks for considering.
I assume implementing setting config file path would be easier overall. If that is the case, then I guess go that way.

Sounds nice.
I think it also makes sense to create a flag to disable configs usage at all if the rules are passed through the CLI.

queer commented

Sorry for the delay! This has been added in 0.8.0 which will be released soon.

No worries, thanks for adding it.