I love Flatpaks, the programs are nicely separated so they don’t interfere with each other. They also don’t have flaws like Snap’s low performance or Nix’s complexity.
But being limited to only graphical apps seems like a real drawback. If one wants to use Flatpaks as their primary package manager there have to be some awkward workarounds for cli programs.
E.g., the prime Flatpak experiene is supposed to be on immutable distros like Silverblue. But to install regular cli programs you are expected to spin up a distrobox (or toolbox) and install those programs there.
Having one arch distrobox where I get my cli programs from will not work, as the package entropy over time will get me the very dependency issues that Flatpak wants to solve.
So what is the solution here? Have multiple distroboxes and install packages in those in alternation and hope the boxes don’t break? Use Nix alongside Flatpak? Use Snaps?
I think Nix is great for installing CLI apps, it’s not that complicated, in fact, it can make many things in your life easier.
This.
Also, @Libretto@iusearchlinux.fyi - you not be aware but you can use Nix in an imperative way (as opposed to declarative), which doesn’t require learning the Nix language or editing config files etc.
Eg: say you wanted to install
tealdeer
, all you need to do is run:nix profile install nixpkgs#tealdeer
There are similar one-liners to search, upgrade, rollback etc.
I use Fedora uBlue (Bazzite), and use Nix to install all my CLI apps, and Flatpak for all my GUI apps. Been running this setup for a few months on and it’s been great experience (bit of a learning curve doing this way of course, but I’m pretty happy with my setup now).
Thanks, I will try that out. I want to use uBlue as well, but cli program installation has been holding me back.
uBlue also makes nix available via fleek, but the way you describe it it seems easier to just use nix directly
ublue contributor here. We’re set up so you can install any cli program from any distro transparently. Should we outline that more in our docs?
Flatpak can do CLI apps it’s just mildly unwieldy because of the whole
flatpak run ...
.If you want reproducible dev environments, yeah you’re pushed to container solutions be it distrobox, Podman or Docker. Or something like nix as a user.
If you install a Debian distrobox it’ll be as reliable as Debian itself is. It’s only an issue when you’re after 100% reproducible systems, which Docker can help somewhat with, or again, nix. Or NixOS if you really want it all system-wide.
flatpak run org.gimp.Gimp image.png
vs.gimp image.png
or evenxdg-open image.png
. “Mildly unwieldy” I suppose but a massive pain in the ass in practice. I can’t believe they thought that it was a good idea to require all that and provide no way to create a script in /usr/local/bin or even .local/bin.All you need is to put
#!/usr/bin/bash flatpak run org.gimp.Gimp $*
in .local/bin/gimp or /usr/local/bin and you can just call
gimp image.png
. A basic alias in your bashrc works, too.That’s a pain in the ass. Why not automate it with the install? They already create .desktop files FFS.
It is actually. Add /var/lib/flatpak/exports/bin to PATH.
This is the answer! Next question is why doesn’t the flatpack install do this for you?
echo 'alias gimp="flatpak run org.gimp.Gimp'" >> ~/.bash_profile
And the other 125 flatpaks I have?
Oh my God I never thought of that! /s
What a pain in the ass to require me to maintain a set of aliases for everything I install. Great user experience.
Flatpak should export mimetypes so xdg-open should work if there isn’t another handler registered
the package entropy over time will get me the very dependency issues that Flatpak wants to solve.
You can declare your distroboxes so that they created regularly from scratch instead of upgrading in place: https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-assemble.md
That way the entropy never hits you. Then use the Prompt terminal https://gitlab.gnome.org/chergert/prompt to make it just part of your terminal ootb.
I wrote a nice little CLI tool that lets you browse the flatpak store in the terminal and has an option to link all your flatpaks to their short names. Its really just a wrapper bash script that runs flatpak, but I like it because it goes from com.Blender.Blender to just “blender” and it works on the command line.
You mean I can stop filling up my .local/bin with bash scripts that just run the flatpak?
Cool, where can we find it?
Flatpaks are disk and memory hogs, and they start slowly. That’s because they’re like little selt-contained full-fledged operating systems.
Flatpaks, like snaps, applimages, dockers, Electron apps, React apps or Flutter apps are the 21st century lazy developer’s way of achieving cross-compatibility without any effort.
I always like comments like this that don’t offer the “real” solution
That’s not true and misleading. Docker and flatpak base images mostly contain shared libraries and even these get automatically deduplicated. Your flatpak calculator doesn’t ship systemd or any other init system nor does it ship system drivers lol
And yeah if you are working in a restrained env and care about those few mbs taken by shared libraries then containarization is not for you.
Containerization is not perfect and it will never be, but that was never the goal. Making apps and services independent of the base system and easily restrictable like mounting volumes, restricting network, etc… was.
If we are talking Silverblue then podman is your pick for everything Flatpack “can’t”
there is no big push for cli flatpack since this already a solved cause with containers for podman/docker/kuberneteshowever no matter how you approach this you will always have dependency security issues
unless you built every flatpack/container yourself you are at the whim of the creator of it to keep every dependecy updated
this is already a known vulnerability factor in the container sphere on topbl of the threat of 0-day exploitsI’m sure you know what you’re talking about. But your comment becomes a techno babble word salad when you throw in a typo or two, skip essential words and forego practically all correct use of punctuation and capitalization. I know this makes me sound old, dumb, and maybe a little mean. I know I’m old and dumb, but I’m really trying to not be mean.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
The point is that you can not find most cli programs on Flathub, de facto making Flatpaks unsuitable for cli programs. Snapcraft on the other hand hosts neofetch, dust, youtube-dl etc.
I’d agree with you
If I could actually find cli app in there