Thoughts on GUI package management in NixOS

I did a more rambly version of this post in Reddit but I wanted to hear from the folks here!

I think NixOS is the best linux backend ever designed, immutability and declarativeness are things any user could benefit from, and it shows in nixpkgs’ massive package availability. But it lacks an intuitive way to install software.
Many GUI package manager attempts have failed and I’d argue they always will as long as there is no standard way to structure a nix config, as they dumb things down or impose a certain structure
(nixui, nix-gui, nix42b, nix-software-center…)

GLF OS sidesteps this by relying on Flatpak, which works well for GUI apps and is already widely supported. But Flatpak can’t manage CLI tools, so it can’t replace Nix.

Since neither Nix nor Flatpak are going away, the most promising path, I’d argue, is to bridge them: making nixpkgs GUI apps buildable as Flatpaks via Nix derivations. That could allow nixpkgs (or part of it) to effectively act as a Flatpak repository, and make anyone packaging for flatpak benefit from nix reproducibility and vice-versa.

I experimented with this idea on a private repo, as there isn’t any nix-to-flatpak tooling around, but Flatpak’s runtime model doesn’t map cleanly to Nix, if I gave the flatpaks access to /nix/store I could run some apps even sandboxed but others (especially Electron/Tauri) would refuse as long as I didn’t compleatly unsandbox them. I think this would require work on flatpak and nixpkgs side.

For now this is a thought experiment, but I’m curious to hear whether this hybrid approach is the right direction for NixOS friendly GUI app management even from folks that know better flatpaks inner workings if this would be even feasable!

1 Like

You can also somewhat declaratively manage flatpaks - not what you asked for, but provides an escape hatch while maintaining the config as the center of control.

1 Like

kinda relevant?

which is also from the creators of nix-software-center, both are a part of SnowflakeOS (dead atm… but did they really have to use genai for the snowfall logo..? bruh…), but those are unrelated and can be used anywhere outside in the snow (get it? no? well, “sandbox” is the playground, right? so, “snowbox”? in the “snow”? which is also something that they made? no? darn, cold crowd… okay…)

(omg i hope these are still being worked on, im freaking out when something wasnt updated in a year or more)

…anyway, i dont hate the idea of it, despite the fact that i had over 9000 problems with flatpaks, but personally i prefer just… text… you know, like a game config or something, except this isnt a game, its a system to play games on, and-

i wish i had known of the existence of these little projects when i was just beginning, man… :wilted_flower: now though, stuff like that, is just straight up useless to me, man. :cigarette: also, am i “wrong” for preferring nixpkgs over flatpak stuff even if i have to sit and wait (or use an extremely user-unfriendly (!) container to run non-nixpkgs packages there in the meantime) for a pull/package request..? cheers!

Nix? Flatpak? Why not both?

security-wise (am no expert), no idea why would one want to double sandbox their already sandboxed nixos though? why not triple, quadruple times, do you know what i mean? if performance of the system isnt a concern, why stop at 2 times the isolation/security? :nerd_face:

edit: ooh, also! almost forgot…

i was a bit curious and, apparently, you can do the same with AppImages! :exploding_head: alas, i am too lazy to even try…

I’m pretty sure the snowfall project (which is used in Snowflake OS) is pretty quiet as the main developer has been busy in real life. I honestly think it should be moved into nix-community perhaps or forked into there to be used as the official GUI method for the GNOME build of NixOS in the near future.

2 Likes

I’m another dissident of the overall idea. There’s a few ways to parse out aspects of some of the desired goals, but a unified GUI experience is not practical and probably not widely desired.

What you are looking for maybe is Nixpak. I tried it and frankly, it’s a hassle to deal with that was layers of indirection on top of nix. I quickly abandoned the effort. What I’m using now is jail.nix, a way more straightfoward bwrap wrapper that is simple and works.

The overall IaC nature of nix and the configs we normally use doesn’t mesh super well with the GUI approach in general. While it could be made to work, it will likely be an enormous outsized effort and for a small part of the community.