]> git.scottworley.com Git - auto-upgrade-with-pinch/commitdiff
Remove comment musing about nix-env --upgrade
authorScott Worley <scottworley@scottworley.com>
Sun, 2 Aug 2026 00:55:33 +0000 (17:55 -0700)
committerScott Worley <scottworley@scottworley.com>
Sun, 2 Aug 2026 00:55:33 +0000 (17:55 -0700)
`nix-env --ugpgrade` is very broken:

* It requires that all channels are interpretable as environments.  This
  usually means creating a `default.nix` with just `{}` in it to keep
  getAllExprs() in nix/src/nix-env/nix-env.cc from recursing around
  looking for packages.

* It fails when otherwise-unused packages have evaluation errors.

* It evaluates all ~100,000 packages in nixpkgs.  This is very slow and
  requires ~12 GiB of RAM.

* It only does updates when the top-level packages in `manifest.nix`
  have version numbers that go up.

  * So packages inside an unversioned `buildEnv` just never get updated.
    Using a single `buildEnv` that is the list of packages you want is
    the standard, recommended way to use `nix-env`.

* A `nix-env --upgrade` after `nix-env --set` will uninstall everything.

upgrade-config.nix

index ba2bb5a4f2969648940a0e79d5437a29e49d98d7..91db2b7ceb6dd23c4f6ef869bc427bfa9f8f3464 100644 (file)
@@ -160,8 +160,6 @@ evalModules {
                     This keeps your environment declarative and ensures that all
                     packages receive regular updates.
                   '';
                     This keeps your environment declarative and ensures that all
                     packages receive regular updates.
                   '';
-                  # It seems like "upgrade" ought to be another choice here, powered
-                  # by "nix-env --upgrade".  But when I tried this, it didn't work.
                 };
               };
             }
                 };
               };
             }