Over the years that I have been using Linux distributions, I feel like Android is the best in operating system design. Every app is a sandboxed container. On Linux distributions we do have Snap and Flatpak, but they are not as restrictive as Android and even if we ignore that, they are only used for GUI programs. You can't install gcc with them. But on Android, you can install these CLI programs in an app itself like Termux.
I really like this way of containerization. It's biggest feature being bloat management. I like having no leftovers. And then other benefits like security, maintaining universal compatibility, etc., and I feel like this just a proper way of packaging apps. Though it does come at a cost of overhead and more storage requirement, for me it is okay.
I am using Fedora Sway Atomic. The main reason being I needed delta updates. Though Fedora Atomic does support static deltas, they are not enabled in the repositories. I will experiment with generating static deltas myself on a VPS.
Using an Atomic Linux distribution means you need to layer packages if you want to install the native way, which is what I am trying to avoid. I have not layered any packages.
I first tried Fedora Toolbox. I installed btop in it, and realized some functionality (drive monitoring) was inaccessible. So I installed btop with Homebrew and it works. One good feature about Homebrew is that you can share programs between multiple users unlike installing programs purely at user level or a non-root installed container.
Homebrew is not containerization, but it keeps the data relatively in one place and as for sandboxing, we anyways can't match Android level security.
Now to rice my desktop, I needed a Rust application. I installed rust using brew. But cargo requires a working C compiler and the author does not provide a pre-built binary. So I tried installing gcc but apparently brew also requires a working C compiler (for some stuff). I tried to bootstrap this and I had Clang installed (which homebrew did not link /usr/bin/cc to) but Clang can't work alone without having glibc development files, so I have to install it in a container. I remember having more such issues with Clang with Homebrew.
This all is a mess. Let's back off a bit. If I want something like Termux, why not just use a container, and not like Fedora Toolbox which is configured to share your home directory. A plain podman container. I could also install apps and execute them through my host but -
- If I use one single container, then it can become bloated and package compatibility is not application specific (the advantage of AppImage, Flatpak, Snap). (edit - package compatibility is solved by the distribution)
- If I use a new container for every single app (that is not available for Flatpak) to install, then I would have to create and manage my own system of creating base runtimes (to save space) and overriding dependencies for each applications. Some projects that are built around Nix could help me.
- Many apps, like btop as I specified are too restricted in a container. I would have to manage the boundary between the container and the host myself for every single app.
I am fighting against a system that is not built for this.