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
Improve install script #1284
Improve install script #1284
Conversation
Linking to #1283, because I stumbled across it when testing this code. |
lgtm @edolstra |
7a5e675
to
b0673e2
Compare
Ping. |
Quote variables where word splitting is clearly not indended.
Same wording, more readable.
Add support for some options at install time: --channel=URL The Nix channel to get expressions from. If URL is empty, no channel will be registered. Default: https://nixos.org/channels/nixpkgs-unstable --channel-name=NAME Optional name to give the Nix channel Default: nixpkgs Also add a bit of help text, invoked with --help.
There is already code in the Nix installer script to subscribe the user to a channel, but the code is bypassed when nix-profile.sh (which is sourced by the installer) has already subscribed the user to a channel. So instead of having two different code paths for doing mostly the same, this patch leaves only one. Another reason for removing this code is that if the user runs "nix-channel --remove nixpkgs", with the intention to build from source (or for whatever reason), on the next login the user is again subscribed to nixpkgs channel. That seems like an anti-feature to me. Update "tests/nix-profile.sh" to reflect that ~/.nix-channels is no longer created by this script.
b35673b
to
6eda5b8
Compare
Ping. I'd like to be able to install Nix on offline network. This PR achieves that (plus some small improvements). I don't mind if an alternative approach is implemented, I just want to be able to (easily) install Nix on a PC that doesn't have access to nixos.org. Any comments? |
Looks good to me! @edolstra? Doesn't seem controversial so maybe one of the other committers could merge it? |
I'm not too keen on adding features to |
@edolstra: Would it be better if I implement the same options in the other installer? Or do you have another idea how to allow installing Nix on offline PC? |
I'll try a different approach. |
See commit messages for details.