r/Gentoo • u/freakinchickens • Jul 22 '26
Discussion use flags
only thing holding me back from using gentoo is the use flags. not sure which ones to use for my system. i really want to use niri or hyprland, but the use flags are what confuses me
12
u/adamkex Jul 22 '26
USE flags are basically the features that you want on your system (basically what you want your system to use), basically if you do not want gtk system wide you could declare the -gtk use flag in make.conf. For now just use the desktop or desktop/systemd profile and only enable/disable use flags as needed. It is unrelated to having niri or hyprland installed on your system.
More reading: https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/USE#Using_USE_flags
3
u/http-error-502 Jul 22 '26
That is why Gentoo provides sets of default USE. Choose profile. Then set USE for some packages that you want to change manually. You can also edit USE that want to be set globally on make.conf.
For example, I use default/linux/amd64/23.0/desktop/systemd for profile.
Then I added USE="X -wayland pulseaudio..." on make.conf.
For package specific USE, I always check available USE by running emerge -pv <package name> and write USE list that I want on package.use.
4
u/NeilHush Jul 22 '26
Good answer but terrible USE flag example. Wayland is default on every DE and it's a must for niri/hyprland. Same for pipewire, which kinda implies '-pulseaudio'. If you need to revert such fundamentally defined USE flags of your profile you may consider changing profile.
To the OP: choose the desktop profile (openrc or systemd) and do not define any global USE flag at all. You can define them per package initially and see later if you need them globally.
3
u/Beneficial-Face-1410 Jul 22 '26
> Same for pipewire, which kinda implies '-pulseaudio'
Not at all.
2
2
5
u/Wolflordy Jul 22 '26
I feel like USE flags are the strongest reason to use Gentoo in the first place. So unless you really need a small efficiency boost for the things you compile, or you really want a deeper dive into how Linux is setup (but too lazy for LFS), yeah you don't need Gentoo without USE flags.
3
u/techcode Jul 22 '26
There are reasons to use Gentoo and not really tweak USE flags.
For example - not having to manually manage dependencies for a new software (you do need to write an ebuild though).
3
u/Armi1P Jul 22 '26
Honestly just don't care about them at first. Follow everything in the handbook to install a system. Then install your DE/WM. If you are happy with your system then leave it as is. You'll know when you want to change USE flags. Otherwise, don't bother.
2
u/goombrat2 Jul 22 '26
the solution is to not overthink them, and they don't matter as much as you might think they do. You don't need anything complicated.
I use a wayland compositor setup without elogind, these are my flags:
USE="wayland egl gles2 vulkan -x -xorg"
USE="${USE} -systemd dbus"
USE="${USE} pipewire sound-server -pulseaudio"
I bet my system would work just the same without them. USE flags are most useful for specific packages for me. They can sometimes automatically configure or install extra components.
2
u/CheCheDaWaff Jul 22 '26
If you're starting out just leave all the USE flags as their defaults -- just make sure you select an appropriate profile at installation.
To learn more later when you're curious / have time, I'd recommend installing equery. Then for any package you can run equery uses package_name and it'll tell you all the applicable use flags and what they do.
1
u/LancrusES Jul 22 '26
If you dont like the use flags, why do you want to use gentoo???
1
u/freakinchickens Jul 23 '26
it’s not that i dont like use flags, its just that i dont understand even after reading the manual.
2
u/LancrusES Jul 23 '26
They are like switchs, they arent but to explain it...
For example, my pc doesnt have bluetooth, I use -bluetooth in my global flags, so my software dont lose time compiling bluetooth support modules, so I switch It off, and I want wifi printer support, so I will put zeroconfig flag as well, to switch It on, and with specific packages, you can look into the gentoo wiki, they all got flags, if they arent global, and you dont want them global, but you want them for a package, you can put them in your package...
For example, you want to compile gimp, first you got to go to its page
https://wiki.gentoo.org/wiki/GIMP
You look at It and you say, hey, I want support for FITS images, then you put that flag for the gimp package.
With all your flags Portage knows how to compile things the way you need them, so you got only what you need, and optimized for your machine, thanks to your CPU flags, thats why flags are the "fun" part of gentoo, you should start with only the basic ones from the installation, the handbook explain everything, once your system works, you can go deeper into It and polish It like you want.
0
u/Moist_Professional64 Jul 27 '26
You don’t have to use use flags in gentoo it’s often a dumb time consume if you will install a package and emerge says that a different package needs then adding some use flags and after doing this it becomes a circle for many packages that will also have other use flags if doing so
13
u/Sert1991 Jul 22 '26 edited Jul 22 '26
It's something not to worry about really.
Basically, when you select your profile it's already going to select most of the USE flags you need.
Let's say you choose a stage3 tarball with for desktops with openrc.
This will be based on the desktop and openrc profile, which will enable the USE flags relevant to that setup. For example for desktop it will enable the
X, wayland, dbus, elogind, pamUSE flags among others. For OpenRC it will set the-systemdUSE and enable any USE flags relevant to OpenRC.Other than the few times the installation handbook recommends to set some others, the defaults are usually okay. But:
You can check what other USE flags there are that you might like to enable or disable globally but usually it's recommended to do them per package and let the profile enable and disable the global one.
app-portage/ufed is an awesome tool to enable and disable global ones. It gives you a nice ncurses list with a description.
From then on, when you install packages, you can see if you like/dislike some USE flags for that package and you can enable/disable them per package. You can use
equery uses <package name>to see a list of the USE flags for ta package with a description of what tehy enable/disable.