5
submitted 4 months ago* (last edited 4 months ago) by chkno@lemmy.ml to c/nixos@lemmy.ml

If I imperatively install packages with nix-env -iA packagename and then update my channels, how do I update the installed packages?

nix-env --upgrade tries to evaluate all of nixpkgs and gets earlyoom-killed after using all (16G) my ram and all (12G) my swap.

I can't get the attr names of installed packages with nix-env --query --installed --attr-path because --attr-path only works with --available, not --installed.

Is keeping track of the attr names separately (not really using nix-env to manage installed packages) the only way?

(Please no "use flakes" or "use declarative nix-env -r with a buildEnv overlay that's the list of packages you want". I understand that these are alternatives. I'm trying to determine if there's any way to use the imperative nix-env -i mechanism and still have automatic updates.)

top 3 comments
sorted by: hot top new old
[-] loudgolem@fosstodon.org 1 points 4 months ago

@chkno there is a nixos module for swapspace, maybe it can help.

[-] crocswithsocks@lemmy.world 1 points 4 months ago

Can you add more swap? Create a temporary swap file and then update? It might take a while to complete but it should work.

[-] chkno@lemmy.ml 2 points 4 months ago

I'm looking for something that can run unobtrusively in the background as an automatic update. I don't have the cgroups wizardry skill to make swapping out many gigabytes non-disruptive to a normal desktop experience.

this post was submitted on 12 Sep 2025
5 points (85.7% liked)

nixos

1537 readers
2 users here now

All about NixOS - https://nixos.org/

founded 5 years ago