From f71599234607ee8b1df328d96605ed91c5489033 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 9 Nov 2025 15:13:15 +0100 Subject: [PATCH] Change channel URLs to channels.nixos.org subdomain Update all channel URLs from https://nixos.org/channels/ to https://channels.nixos.org/ to use the more reliable subdomain. The nixos.org domain apex lacks IPv6 support due to DNS hoster limitations. Using the subdomain allows better CDN distribution and improved reliability. Updated files: - Installation scripts (multi-user and tarball installers) - Channel URL resolution in eval-settings.cc - Documentation and examples - Docker image default channel URL - Release notes (added note about URL change) Fixes #14517 --- doc/manual/rl-next/channels-subdomain.md | 9 +++++++++ doc/manual/source/command-ref/nix-channel.md | 6 +++--- doc/manual/source/release-notes/rl-2.0.md | 2 +- docker.nix | 2 +- scripts/install-multi-user.sh | 2 +- scripts/install-nix-from-tarball.sh | 2 +- src/libexpr/eval-settings.cc | 2 +- src/libexpr/primops.cc | 2 +- 8 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 doc/manual/rl-next/channels-subdomain.md diff --git a/doc/manual/rl-next/channels-subdomain.md b/doc/manual/rl-next/channels-subdomain.md new file mode 100644 index 000000000..38dc7bb33 --- /dev/null +++ b/doc/manual/rl-next/channels-subdomain.md @@ -0,0 +1,9 @@ +--- +synopsis: Channel URLs migrated to channels.nixos.org subdomain +prs: [14518] +issues: [14517] +--- + +Channel URLs have been updated from `https://nixos.org/channels/` to `https://channels.nixos.org/` throughout Nix. + +The subdomain provides better reliability with IPv6 support and improved CDN distribution. The old domain apex (`nixos.org/channels/`) currently redirects to the new location but may be deprecated in the future. diff --git a/doc/manual/source/command-ref/nix-channel.md b/doc/manual/source/command-ref/nix-channel.md index 3d02a7d40..865f43ccc 100644 --- a/doc/manual/source/command-ref/nix-channel.md +++ b/doc/manual/source/command-ref/nix-channel.md @@ -11,7 +11,7 @@ Channels are a mechanism for referencing remote Nix expressions and conveniently retrieving their latest version. The moving parts of channels are: -- The official channels listed at +- The official channels listed at - The user-specific list of [subscribed channels](#subscribed-channels) - The [downloaded channel contents](#channels) - The [Nix expression search path](@docroot@/command-ref/conf-file.md#conf-nix-path), set with the [`-I` option](#opt-I) or the [`NIX_PATH` environment variable](#env-NIX_PATH) @@ -88,9 +88,9 @@ This command has the following operations: Subscribe to the Nixpkgs channel and run `hello` from the GNU Hello package: ```console -$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable +$ nix-channel --add https://channels.nixos.org/nixpkgs-unstable $ nix-channel --list -nixpkgs https://nixos.org/channels/nixpkgs +nixpkgs https://channels.nixos.org/nixpkgs $ nix-channel --update $ nix-shell -p hello --run hello hello diff --git a/doc/manual/source/release-notes/rl-2.0.md b/doc/manual/source/release-notes/rl-2.0.md index aad0de211..25cc5e0a5 100644 --- a/doc/manual/source/release-notes/rl-2.0.md +++ b/doc/manual/source/release-notes/rl-2.0.md @@ -358,7 +358,7 @@ This release has the following new features: they are needed for evaluation. - You can now use `channel:` as a short-hand for - . For example, + [now ]. For example, `nix-build channel:nixos-15.09 -A hello` will build the GNU Hello package from the `nixos-15.09` channel. In the future, this may use Git to fetch updates more efficiently. diff --git a/docker.nix b/docker.nix index 9dbc34d61..32205224b 100644 --- a/docker.nix +++ b/docker.nix @@ -10,7 +10,7 @@ tag ? "latest", bundleNixpkgs ? true, channelName ? "nixpkgs", - channelURL ? "https://nixos.org/channels/nixpkgs-unstable", + channelURL ? "https://channels.nixos.org/nixpkgs-unstable", extraPkgs ? [ ], maxLayers ? 70, nixConf ? { }, diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh index b013190f9..5ff760a61 100644 --- a/scripts/install-multi-user.sh +++ b/scripts/install-multi-user.sh @@ -714,7 +714,7 @@ EOF place_channel_configuration() { if [ -z "${NIX_INSTALLER_NO_CHANNEL_ADD:-}" ]; then - echo "https://nixos.org/channels/nixpkgs-unstable nixpkgs" > "$SCRATCH/.nix-channels" + echo "https://channels.nixos.org/nixpkgs-unstable nixpkgs" > "$SCRATCH/.nix-channels" _sudo "to set up the default system channel (part 1)" \ install -m 0644 "$SCRATCH/.nix-channels" "$ROOT_HOME/.nix-channels" fi diff --git a/scripts/install-nix-from-tarball.sh b/scripts/install-nix-from-tarball.sh index fd00460ec..f17e4c2af 100644 --- a/scripts/install-nix-from-tarball.sh +++ b/scripts/install-nix-from-tarball.sh @@ -213,7 +213,7 @@ fi # Subscribe the user to the Nixpkgs channel and fetch it. if [ -z "$NIX_INSTALLER_NO_CHANNEL_ADD" ]; then if ! "$nix/bin/nix-channel" --list | grep -q "^nixpkgs "; then - "$nix/bin/nix-channel" --add https://nixos.org/channels/nixpkgs-unstable + "$nix/bin/nix-channel" --add https://channels.nixos.org/nixpkgs-unstable fi if [ -z "$_NIX_INSTALLER_TEST" ]; then if ! "$nix/bin/nix-channel" --update nixpkgs; then diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index 93db5aebb..33c90259f 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -92,7 +92,7 @@ bool EvalSettings::isPseudoUrl(std::string_view s) std::string EvalSettings::resolvePseudoUrl(std::string_view url) { if (hasPrefix(url, "channel:")) - return "https://nixos.org/channels/" + std::string(url.substr(8)) + "/nixexprs.tar.xz"; + return "https://channels.nixos.org/" + std::string(url.substr(8)) + "/nixexprs.tar.xz"; else return std::string(url); } diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 0bd03b232..33aa29f3a 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -2234,7 +2234,7 @@ static RegisterPrimOp primop_findFile( > - ``` > { > prefix = "nixpkgs"; - > path = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz"; + > path = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; > } > ```