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

Documentation no longer correct for stable Nix #335

Open
AndrewKvalheim opened this issue Feb 6, 2023 · 4 comments
Open

Documentation no longer correct for stable Nix #335

AndrewKvalheim opened this issue Feb 6, 2023 · 4 comments

Comments

@AndrewKvalheim
Copy link

The instructions for stable now fail as in #292:

$ nix run \
  --option extra-substituters 'https://nixpkgs-update.cachix.org/' \
  --option extra-trusted-public-keys 'nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8=' \
  -f https://github.com/ryantm/nixpkgs-update/archive/main.tar.gz \
  -c nixpkgs-update --help
error: unrecognised flag '-c'
Try 'nix --help' for more information.

On stable, the instructions for unstable fail with:

$ nix shell \
  --option extra-substituters 'https://nixpkgs-update.cachix.org/' \
  --option extra-trusted-public-keys 'nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8=' \
  -f https://github.com/ryantm/nixpkgs-update/archive/main.tar.gz \
  -c nixpkgs-update --help
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
nix-info
$ nix-shell --packages 'nix-info' --run 'nix-info --markdown'
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.90, NixOS, 22.11 (Raccoon), 22.11.2203.285b3ff0660`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `"nixos-22.11, nixos-hardware"`
 - channels(user): `"home-manager-22.11.tar.gz, rust-overlay, unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@gofastlily
Copy link

I'm running into this issue on a default Windows 11 install of WSL2

@nh2
Copy link
Contributor

nh2 commented Jul 1, 2023

There are now 4 reasons why the install instructions don't work:

  • unrecognised flag '-c'
    • What did -c even do?
  • experimental Nix feature 'nix-command' is disabled
  • default.nix was removed: da82da1#commitcomment-120340238
  • nix run [..] nixpkgs-update --help passes --help to nix run, not to nixpkgs-update; it should be nix run [..] -- nixpkgs-update --help

@nh2
Copy link
Contributor

nh2 commented Jul 1, 2023

I found a workaround, tested on commit 074e47e:

nix run:

nix --extra-experimental-features nix-command run --impure --expr 'let repo = builtins.fetchTarball https://github.com/ryantm/nixpkgs-update/archive/main.tar.gz; in import "${repo}/pkgs/" { system = "x86_64-linux"; self = repo; nixpkgs = <nixpkgs>; mmdoc = null; }' -- nixpkgs-update --help

nix shell:

nix --extra-experimental-features nix-command shell --impure --expr 'let repo = builtins.fetchTarball https://github.com/ryantm/nixpkgs-update/archive/main.tar.gz; in import "${repo}/pkgs/" { system = "x86_64-linux"; self = repo; nixpkgs = <nixpkgs>; mmdoc = null; }' nixpkgs-update

@ryantm The manual import call of my workaround doesn't look very clean. Can the default.nix in the top-level of the repo be introduced?

@eclairevoyant
Copy link

I found a workaround

It's not really a "workaround", it's just how the CLI works.
nix run -c was moved over to nix shell -c years ago.
Docs need fixing.

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

No branches or pull requests

4 participants