this post was submitted on 19 Dec 2025
3 points (100.0% liked)
Nix / NixOS
2555 readers
2 users here now
Main links
Videos
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would generally not recommend installing packages like that (even though it's often the first thing you see on websites), prefer declaring it in your configuration.nix or use nix-shell -p for a quick test of a package. It might be helpful to run the program through the terminal to get more useful debugging output
Do you mean that this command
nix-env -iA nixpkgsis not recommended ? For what reason ? If it's not recommended, how do I uninstall an app that I installed packaged withnix-env? Then I add aconfiguration.nixwith this commandkate /etc/nixos/configuration.nix, then I copy and pasteis it correct ? Because I don't have a "nixos" folder in my
/etc/. After creating a.nix configurationfor a Mullvad package, how do I install this app ? I have already executed this commandnix-shell -p mullvad-vpnbefore but it gives a resultThe point of using Nix as opposed to something like flatpak (or apt) is that all of your packages are managed through a text file (aka "declaratively"). The benefit of this approach is that, if you ever install a package that breaks something, you can easily undo any installation or system setting by reverting it in that single location. You also don't get the problem where your computer slowly fills up with stuff you no longer need, because necessary programs would only be pulled in if they're needed by ones you defined. This is also very nice for developers because it makes a system environment easy to replicate.
By installing packages with that command, you're removing the main benefits of Nix, which is why it isn't recommended. The recommended way to do it is to edit your nix configuration file with the package you want, and then run the nix rebuild command which will actually download the package. (There's also a clean command which will fully remove previously installed programs no longer being used)
NixOS is a Linux distribution built entirely around this concept, where everything about the OS is managed by Nix. Since you're just installing Nix on a steam deck, the config file won't be under /etc/nixos, but a different location. I'm honestly not too sure where though because I've only ever used Nix on NixOS.