Ever since I'm running some niche distros like Void, Solus, I had a problem finding softwares I need in their not-so-large repositories, also I don't like how flatpak and snap works. so i decided to create an Arch Linux chroot enviroment everytime I distrohop. Why Arch Linux? They have a really, really good repositories, oh and don't mention how big AUR is.
**IMPORTANT**, Make sure you've unmounted everything in chroot enviroment, it's better to remove the init script and reboot to unmount everything. if you can't reboot for some reason, do :
```
/usr/local/share/archbox/bin/archboxinit stop
```
, then do :
```
mount
```
make sure there's no mounted Archbox directories and then delete the Arch Linux directory.
Keep in mind that this doesn't resolve service dependencies, so you may need to enable the dependencies manually. you can use ```archboxctl desc <service>``` to read the .service file
##### Post-exec delay
Services are asynchronously started, if some services have some issues when starting together you may want to add post-exec delay.
```
SERVICES=( php-fpm:3 nginx )
```
This will add 3 seconds delay after executing php-fpm.
Instead of opening terminal or installing desktop entries everytime you want to run application inside chroot, you may want to launch rofi inside chroot, install rofi and do :
Mounting ```/run``` somehow breaks NixOS, set ```MOUNT_RUN``` in ```/etc/archbox.conf``` to anything other than ```yes``` to disable mounting ```/run```, then do :
```
archbox --mount-runtime-only
```
after user login to make XDG runtime directory accessible to chroot enviroment. make sure dbus unix:path is in XDG runtime directory too.
Or alternatively if you use WM-only, just disable mounting ```/run``` entirely and manually set XDG_RUNTIME_DIR into ```/tmp``` like ```/tmp/$(whoami)```.
after user login, Also if you use Void Musl, you need to kill every process that runs in XDG_RUNTIME_DIR when you log out, You need to reinstall archbox with ```--exp``` flag and use ```startx-killxdg``` instead of ```startx```, or run :
```
/usr/local/share/archbox/bin/remount_run killxdg
```
on logout. you can put it in ```/etc/gdm/PostSession/Default``` if you use GDM
```pkexec``` is kind of tricky to make it work in chroot, if you use rofi to launch GUI applications in chroot, you may not able to launch any ```.desktop``` files with ```Exec=pkexec...``` in it. If you really want them to work, you can do :
in chroot and prevent pacman from restoring ```/usr/bin/pkexec``` by editing ```NoExtract``` in ```/etc/pacman.conf```.
#### No sudo password in chroot by default.
You could use ```sudo``` in archbox, but you'll have no way to enter the password when doing e.g. ```archbox sudo pacman -Syu```. also you could enter the password if you do ```archbox -e <<(echo $COMMAND)```, but that would disable stdin entirely during $COMMAND.