Skip to content

nixos/nix-channel: fix subscribing to default channel#264608

Merged
nikstur merged 1 commit intoNixOS:masterfrom
nikstur:nix-channel-fix-default
Oct 31, 2023
Merged

nixos/nix-channel: fix subscribing to default channel#264608
nikstur merged 1 commit intoNixOS:masterfrom
nikstur:nix-channel-fix-default

Conversation

@nikstur
Copy link
Contributor

@nikstur nikstur commented Oct 31, 2023

Description of changes

Fixes #264602

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@nikstur nikstur requested a review from eclairevoyant October 31, 2023 15:52
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 31, 2023
Copy link
Member

@RaitoBezarius RaitoBezarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@eclairevoyant eclairevoyant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual testing seems to confirm this is fixed, approving.

@nikstur
Copy link
Contributor Author

nikstur commented Oct 31, 2023

I'll wait for ofborg eval, which might take a few hours, and merge then.

@nikstur
Copy link
Contributor Author

nikstur commented Oct 31, 2023

@ofborg test activation-nix-channel

@delroth delroth added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Oct 31, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Oct 31, 2023
@nikstur nikstur merged commit 37209a6 into NixOS:master Oct 31, 2023
@nixos-discourse
Copy link

@mhwombat
Copy link
Contributor

mhwombat commented Nov 1, 2023

Now that the PR has been merged, I have a new symptom that I think is related. I did the fix:

sudo nix-channel --remove nixos && sudo nix-channel --remove \"
sudo nix-channel --add https://channels.nixos.org/nixos-unstable nixos

So now I have:

✦ ❯ sudo nix-channel --list
nixos https://channels.nixos.org/nixos-unstable

But when I rebuild, I get this error:

✦ ❯ sudo nixos-rebuild switch --upgrade
[sudo] password for amy: 
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
       … <borked>

         at «none»:0: (source not available)

       … while calling the 'import' builtin

         at «string»:1:6:

            1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
             |      ^

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
building Nix...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
/tmp/nixos-rebuild.86Fpgf/nix
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)
building the system configuration...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)

nixos on  main [!?] took 3s 

@eclairevoyant
Copy link
Contributor

Did you run nix-channel --update as root? BTW I think how-to questions are better asked on say, discourse

@mhwombat
Copy link
Contributor

mhwombat commented Nov 1, 2023

@eclairevoyant Thank you; that solved the problem.

Apologies for asking here instead of on Discourse. I thought since this was a known issue, it would be helpful to others to have the full fix documented here. But now that I know the solution was nix-channel --update, I realise that Discourse was the best place to ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid channels added to root channels list

6 participants