-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos: switch the package installation prefix from nixos.
to nixpkgs.
#50427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
One open question is how the upgrade path for existing NixOS would look like. The change should be backward-compatible except for manual instructions. It would be nice if old users could use both the old and new notations. |
I'm not voicing opinions yet for or against anything just laying out there some things I initially thought about. I first wanted to point out the introductory paragraph, quickly read, reads like you're saying "nixos-unstable gets stuck, so let's use nixpkgs-unstable instead" which I think is not what you're saying. It might be a good idea to increase specificity there and say that you want to rename the installed channel's name, and not change the default selected channel. The
It will make the defaults for unstable kinda go against the grain of how I'm curious: what is the status of this PR with regards to backwards compatibility? Any notes and ideas? Things I see:
Anything else I would have missed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is an excellent simplification. I don't really have a firm understanding of where exactly we might still have references to nixos
so consider this an approval in principle, not in implementation.
Can we somehow make installations with |
I think it's a good idea to make this more consistent.
|
I think we should not change this at this time, because 1) it's an incompatible change; and 2) all of this will change anyway once we have flakes and a nix-channel replacement. |
e659501
to
8c9b480
Compare
Closing then? |
@edolstra can you say something about the status of that? Is there a chance it will be ready for the next release? When not we could still use this workaround in the next NixOS release until we have a clean solution. It might be a huge help for (new) Nix(OS) users. |
What about aliasing those two in some way? (i.e. by default |
@edolstra are there details published about the nix-channel replacement? flake.nix is still in early development and sounds good on paper. At this point it seems easier to me to fix the existing NixOS system but happy to help on nix-channel instead. I would like to avoid having this PR blocked for a change that will happen 2 years down the line. |
I think I found a backward-compatible way of tweaking the layout of
TBC |
8c9b480
to
ed92e37
Compare
The only issue is
|
Does that mean it also evaluates nixpkgs twice, or is that memoised? If it has to evaluate twice that's quite a pain… |
It's evaluated twice when using |
The `./nixpkgs -> .` symlink was introduced as a way to allow backward-compatibility. Instead of generating it on channel creation, add it to the repository directly. That way even a git checkout will work the same way.
Alias the "nixos" channel to "nixpkgs" in `~/.nix-defexpr` on NixOS. This allows for a migration path for both NixOS and non-NixOS users of using the same nix-env command to install a package: nix-env -iA nixpkgs.hello It means that we can start fixing our docs today to use the same prefix everywhere. As a downside it almost doubles the time of evaluating `nix-env -qaP` and also doubles the entries in the list. Instead, the user should be directed to use the new `nix search` command which respects NIX_PATH, is fast and outputs only the "nixpkgs" prefixes.
Update the docs to instruct the users to use: nix-env -A nixpkgs.hello Instead of: nix-env -A nixos.hello
Make the output consistent with `nix search`
ed92e37
to
22702c1
Compare
nixos.
to nixpkgs.
This PR has changed from switching the channel name to tweaking |
How does this change, minor for bigger computers, impact weaker computers with low memory?
Some of the smallest ec2 instances can already not instantantiate nixpkgs.
… On Nov 17, 2018, at 13:07, zimbatm ***@***.***> wrote:
This PR has changed from switching the channel name to tweaking ~/.nix-defexpr to allow the unification of prefixes during nix-env -iA installs. I updated the PR description to reflect the new approach. This makes the PR backward-compatible and allows us to update and simplify the documentation.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or mute the thread.
|
As long as the command uses NIX_PATH instead of the old Not impacted by this PR:
Impacted:
TODO: test the following commands:
Did I miss anything? |
Modifying Also given that many systems are already barely able to evaluate Nixpkgs, evaluating it twice isn't really an option. |
I am currently blocked on resolving all the constraints:
Potential routes I can see: |
|
Motivation for this change
This is a proposal to change NixOS so that packages can also be installed with the same prefix as non-NixOS machines:
Before:
After:
The goal is to reduce the complexity in installation instructions so we can tell all our users to use the same command to install packages. It also fixes issues where
nix search
will return one prefix and thennix-env
will need the other-one. Or the user having to remember on which machine they are installing a package.This change is backward-compatible. The main downside is that
nix-env -qaP
takes twice as long to execute.EDIT: updated the proposal, it was initially about switching channels
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)