[kwlug-disc] Help installing Nix packages the Proper Way(tm)
Scott King
me at kingscott.ca
Tue May 12 18:13:58 EDT 2026
Hey Paul,
Nix(OS) is a strange, and almost exclusive system.
I've installed NixOS on a machine a couple weeks back after a few times of trying. Admittedly, I needed some help from the robots to get my config behaving how I'd like it. I'm less familiar with Nix on Debian, but similar concepts should still apply.
Hope this helps.
nix-shell is a testing environment for whatever package you "installed." Once you close the shell, it's gone.
nix-env is the synaptic-style command equivalent, something like apt get. It's "discouraged" because Nix is all about an atomic, reproducible and declarative system.
nix profile is good for using Nix on a system that's not NixOS. The way profile stores packages is a la Nix and makes builds reproducible. It's still an imperative operation though.
To install a package, you'd do something like:
nix profile install nixpkgs#ripgrep
(If you used home-manager as well, you could edit a local config file and populate home.packages = [ ... ]; for new packages and rebuild. home-manager is to manage your application config + local dotfiles.)
Last but not least is flakes. This is still experimental, but a flake is a snapshot of a package, with a flake.lock file, defining the inputs/outputs. It is reproducible by nature. To my knowledge, it's lacking good support outside of NixOS, but I could be wrong.
BUT, good news is that nix profile stores packages as flakes, so you're getting the benefit there. This is the main reason that leads me to believe it's recommended over nix-env​.
If you decide to run full NixOS, the configuration for the system all happens within a configuration.nix (+ optional flake.nix). That is rebuilt and versioned on the system, allowing you to jump in between them.
My NixOS config is here: https://github.com/kingscott/kingscott.nix.
Thanks,
Scott
Scott King
On Tuesday, May 12th, 2026 at 12:06 PM, Paul Nijjar via kwlug-disc kwlug-disc at kwlug.org wrote:
> I know everybody loves Nix and NixOS but I find it so frustrating.
> The documentation is so misleading and I do not know the "right" way
> to do things, and then I do things the wrong way and suffer.
>
> Here is what I did:
>
> - I started with Debian Trixie
> - I followed the advice here to install nix-setup-systemd and add
> myself to the nix-users group and add the unstable channel using
> nix-channel : https://imranmustafa.net/nix-on-debian/
>
> - Then I looked for the version of the package I wanted to install:
>
> https://lazamar.co.uk/nix-versions/?package=newsboat&version=2.21&fullName=newsboat-2.21&keyName=newsboat&revision=3b05df1d13c1b315cecc610a2f3180f6669442f0&channel=nixpkgs-unstable#instructions
>
> On that page there are six different invocations for what I should do
> to install the package, and apparently they are all incorrect? The
> documentation I linked above says to use nix-env, but people on Reddit
> say that nix-env is bad and you should use nix profile, and then other
> people say that is wrong and you should use Home Manager and then
> people say that is too complicated etc etc etc.
>
> Here is what I want:
> - Let me install this package, preferably by editing a text file and
> running a command to activate the text file.
> - It is fine for me to be the only one that runs this package
> - I want the package installed permanently, not in a transient way
> - If I am supposed to make a text file, tell me exactly what the
> filename is and where it goes[1], and tell me what should be in the
> file. If you point me to documentation that is fine, but if the
> documentation veers off into abstractoland immediately then that is
> not helpful.
> - If I need to run some other commands in order to set up the platform
> for that text file then that is okay; please tell me what commands I
> need.
> - Tell me what I need to run in order to get the package installed so
> that I am doing thing the Right Way and not going to be burned. If
> any of these ways is the Right Way that is fine, but tell me
> something that will work and not get me burned.
>
> Can any of you Nix wizards help a stupid mortal out?
>
> Am I the only one who finds the learning curve for this package
> manager stupidly high? I would have thought that with its popularity
> there would be clearer documentation.
>
> [1] Don't do this:
> https://nix.dev/tutorials/first-steps/declarative-shell#a-basic-shell-nix-file
> ("create a file called shell.nix" . Okay. Where is this file
> supposed to live? Anywhere? Some specific folder?)
>
> _______________________________________________
> kwlug-disc mailing list
> To unsubscribe, send an email to kwlug-disc-leave at kwlug.org
> with the subject "unsubscribe", or email
> kwlug-disc-owner at kwlug.org to contact a human being.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20260512/c2c6de5a/attachment-0001.htm>
More information about the kwlug-disc
mailing list