Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

bjornfor
Copy link
Contributor

See commit messages for details.

@bjornfor
Copy link
Contributor Author

Linking to #1283, because I stumbled across it when testing this code.

@domenkozar
Copy link
Member

lgtm @edolstra

@bjornfor
Copy link
Contributor Author

Ping.

Quote variables where word splitting is clearly not indended.
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.
@bjornfor
Copy link
Contributor Author

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?

@copumpkin
Copy link
Member

Looks good to me! @edolstra? Doesn't seem controversial so maybe one of the other committers could merge it?

@edolstra
Copy link
Member

I'm not too keen on adding features to scripts/install-nix-from-closure.sh, to prevent having two different installers with divergent feature sets.

@bjornfor
Copy link
Contributor Author

@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?

@bjornfor
Copy link
Contributor Author

I'll try a different approach.

@bjornfor bjornfor closed this Oct 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants