Commit graph

95 commits

Author SHA1 Message Date
Alex David
5e86199537 Include deprecated combinators in the docs 2025-08-07 17:23:52 -07:00
Alex David
2ca02c8bfe Use camelCase for state attributes 2025-08-07 16:36:13 -07:00
Alex David
595bc0e2e4 Allow overriding bubblewrap 2025-08-07 16:32:58 -07:00
Alex David
06c7210127 Refactor path handling
* Moves the default coreutils path into base permissions to allow
  override.
* Makes paths defined *later* in the permissions list appear *earlier*
  which should have the effect of later calls to `add-path` override
  binaries provided by earlier ones.
* Makes the `path` variable on state a list rather than a string.
2025-08-07 16:26:18 -07:00
Alex David
7f17289a72 Add CI 2025-08-07 15:59:48 -07:00
Alex David
c7685334cf Restructure source 2025-08-07 15:54:50 -07:00
Alex David
09edd097b9 Clean up combinator/permission naming
The term `combinator` was overloaded before, being used to refer both to
the functions that are exposed to help build a jail, and their return
value to be passed into `jail`/`basePermissions`. This commit renames
the latter to `Permission`.
2025-08-07 15:42:36 -07:00
Alex David
f18f1cf701 Allow overriding jail base permissions 2025-08-07 15:29:16 -07:00
Alex David
24de419827 Create dconf config dir if it doesn't exist 2025-07-21 20:26:12 -07:00
Alex David
aa544c66a3 Allow unset XCURSOR_* vars for gui combinator 2025-07-21 20:21:03 -07:00
Alex David
ac316857f4 Allow unset readonly-paths-from-var variable 2025-07-21 20:19:50 -07:00
Alex David
ba42171b16 Add readonly-paths-from-var combinator 2025-07-18 11:30:55 -07:00
Alex David
3abb0273cd Add app to run all tests with nice output 2025-07-18 10:46:48 -07:00
Alex David
38b5138956 Add initial simple test cases 2025-07-17 20:25:17 -07:00
Alex David
921b443cc9 Remove which in builtin passwd combinator
This remove the requirement on `which` binary when running any jail.
This was preventing jailed apps from running within nix sandbox without
manually specifying `pkgs.which` as a build input.
2025-07-17 20:23:20 -07:00
Alex David
8dc2189e08 Add combinators to bind runtime args
This adds `readonly-runtime-args` and `readwrite-runtime-args`
combinators.
2025-07-14 21:10:30 -07:00
Alex David
c5ba72dc5a 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.
2025-07-11 11:44:12 -07:00
Alex David
2f6e7c3078 Improve docs 2025-07-11 11:16:47 -07:00
Alex David
b10ff57b1e Add cleanup combinator 2025-06-14 22:11:21 -07:00
Alex David
fce1224bdd Use __functor to simplify combinators
By using `__functor` combinators can call each other directly by using
`rec` rather than needing to mapAttrs over all of the combinators to
inject them into each one.
2025-06-13 22:14:13 -07:00
Alex David
313d10b952 Improve add-runtime documentation 2025-06-07 20:12:40 -07:00
Alex David
88e361ab35 Fix escape documentation 2025-06-07 16:55:56 -07:00
Alex David
182ac7bc24 Add mailing list link 2025-06-07 16:50:40 -07:00
Alex David
9df05d4339 Update readme with link to combinator docs 2025-06-07 16:37:46 -07:00
Alex David
a5c957f45b Rename getOpts to applyCombinators 2025-06-07 16:37:26 -07:00
Alex David
5a1d814b63 Add include-once combinator 2025-06-07 16:09:18 -07:00
Alex David
131aa12bba Add xwayland combinator 2025-06-07 15:26:50 -07:00
Alex David
8d9acc76f3 Add wrap-entry combinator 2025-06-07 15:19:45 -07:00
Alex David
83738cbb8e Fix indentation 2025-06-07 15:14:29 -07:00
Alex David
f0fd252dd0 Add links to combinator implementations in docs 2025-06-07 14:36:51 -07:00
Alex David
35347831a2 Refactor GUI combinators
This refactors the `gui` combinator to be a composition of pipewire, and
the new combinators `wayland` and `pulse`.
2025-06-07 13:45:31 -07:00
Alex David
e58d6bef4f Rename dbus-unsafe to unsafe-dbus 2025-06-07 13:35:56 -07:00
Alex David
6854d37560 Add initial docs website 2025-06-07 12:48:30 -07:00
Alex David
cb157b9dce Add documentation to combinators
This adds structured documentation and signatures to all combinators. A
future commit will consume this to generate a documentation website.

But for now having the docs in the source code is helpful to anyone
viewing `combinators.nix`.
2025-06-07 12:28:44 -07:00
Alex David
f54d444e2a Bind all /dev/video* for camera combinator
This updates the `camera` combinator to bind all `/dev/video*` devices
found at runtime. This also means bubblewrap won't crash if `camera` is
specified but there is no camera attached.
2025-06-07 11:16:05 -07:00
Alex David
2f2bea6e74 Fix typo in readme 2025-05-28 09:33:25 -07:00
Alex David
3c0a3b807b Allow sharing namespaces other than net 2025-05-17 11:19:23 -07:00
Alex David
a8dcbbefa6 Break time-zone into its own combinator 2025-05-14 09:37:30 -07:00
Alex David
8ee01f1769 Refactor lib.nix 2025-05-11 15:30:43 -07:00
Alex David
d84314ffc7 Rework persisthome
* Use new data dir for persisted homes (~/.local/share/jail.nix/home
  instead of ~/.local/share/jails)
* Rename `persisthome` -> `persist-home` (with deprecation warning when
  using the old name)
2025-05-11 15:30:43 -07:00
Alex David
8da2af4368 Rework /etc/{passwd,group} and update datadir
* Generates a valid /etc/group for mounting in jails
* Updates data dir from ~/.local/share/jails to ~/.local/share/jail.nix
  (persisthome will be updated to use the new datadir in the next commit)
* Fixes an error if data dir isn't created yet
2025-05-11 15:30:43 -07:00
Alex David
08e7907337 Move helpers into lib.nix 2025-05-11 15:30:43 -07:00
Alex David
dd40b566ac Rename helpers -> combinators 2025-05-11 15:30:43 -07:00
Alex David
162e22d7ca Add readme 2025-04-27 12:29:05 -07:00
Alex David
25168bde2c Add initial spike 2025-04-27 12:07:03 -07:00