https://blue-build.org/ logo
Adding "post-install" programs that aren't part of...
# questions
m
Hey, just getting started with fedora silverblue and discovering bluebuild. I'm trying to still build up an understanding and approach of where things should go. The intro docs say resist the urge to add the whole universe (https://blue-build.org/learn/mindset/#resist-the-urge-to-add-the-entire-universe), so my question is what's the approach to handling those other flatpaks, etc. Is this something people would use justfiles for? Something else? Or do you just install those by hand once and hope you don't need to do it again? Coming from nixOS if that helps.
a
message has been deleted
g
You can install whatever flatpaks you want while using your computer. The flatpak module is just there to make sure those are installed for you via a
systemd
service. Anything that has to be installed in the more traditional sense is generally going to be put in the recipe. I install all of my dev tools into my image. It makes my image bigger, but they are part of the OS. Flatpaks run in containers and are installed in your home directory (user) or in
/var
(system) which is writeable
m
Not sure I understand, the flatpaks listed in the recipie don't actually end up part of the image?
g
No, they get installed at boot
m
Nice
Same with the programs in the DNF module too?
g
No, dnf installs on the image
m
Ah okay
g
That's what I meant in the traditional sense
Flatpak is a runtime only system
m
So you would install something like ripgrep into the image?
Or if you were using a different shell?
g
If you use
dnf
to install it
Any script that would install into say
/usr/local/bin
(symlinked in
/var/usrlocal
) at runtime would work. Anything that installs into your home dir will work
Anything trying to install into
/usr/bin/
will not work at runtime as those are readonly path mounted from your image
So you could do
cargo install ripgrep
at runtime if you wanted
m
Gotcha, I'm just trying to understand an example of what kind of dev tools you install directly into the image
m
Oh interesting
Okay, one thing I'm still trying to figure out is the per-project stuff.
g
??
m
LIke if you are working on project A that's using elixir 1.17 and project B that is using elixir 1.18, what's your approach there?
g
You can always use distrobox for something like that
m
Sure, I'm just asking what's your approach
g
I'm usually developing rust projects
I just use
rustup
for managing that
m
Coming from nix, I'd normally have elixir (latest) listed in my userspace config, and then each project would have its own flake that lists the specific version for that project
Hmm okay so you're handling that the same way you would on just any other distro
g
Pretty much
m
Cool, thanks for sharing
g
It's just a system that packs it all into a container image
It's not a complex graph of dependencies like nix can be
Each module you define in your recipe is just a
RUN
instruction in a Containerfile that runs scripts that take in the the module information and perform actions on it
You can get a better sense of what it's doing if you run
bluebuild generate <recipe_path>
from the root of your repo
m
Looking at that right now actually
Like I said, I'm still new to the whole fedora atomic thing
g
If you've ever used docker or podman, it's that same system
m
Sure, I think the snags I've run into are adding the things like my terminal, editor, that kind of stuff. Things that I want universally available
g
If you want to build something and copy it to your final image you can make use of [stages](https://blue-build.org/reference/stages/)
I do that for helix
m
That's for something you're building from source or what?
g
YEs
So you don't pollute your final image with all the dev tools you need to build it
m
Ah okay, so I'm guessing it's basically just another build stage in the containfile that copies some final built artifact
g
Yup
m
Makes sense
Maybe I'll try setting up devpod for a project and see if that takes the place of the per-project flakes for me
g
Yeah the Ublue team uses those
m
Well looks like my iso is done flashing so here goes nothing
Thanks
g
Have fun
x
this is what i use https://mise.jdx.dev/
i ship only my shell, prompt, and my CLI essentials in my image
other tools are in a user-level mise config
it's great for getting different versions of devtools in different projects
only problem is dynamically linked c libraries that are usually recommended to install using dnf, but for those i use a distrobox usually
m
Yeah this is exactly the first problem I ran into
Maybe I'll try again using your approach
For now , I'm experimenting with exporting the bins I need to a dir in the project and then using direnv to add those onto my path
It's working okay so far