From fb4cc15f397f82d3e13538b960a136c02a6deac2 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 14 Nov 2025 15:07:26 +0100 Subject: [PATCH] chore: update nixos channel URLs Channels have moved from `nixos.org/channels` to `cnannels.nixos.org`. This udates all relevant links (excluding release notes) to use the new canonical URLs and replaces HTTP with HTTPS. Fixes #1031. Change-Id: I212821c44ac5e482c8e9eaa415c7d8ee17ff8341 Signed-off-by: adam --- doc/manual/src/command-ref/nix-build.md | 2 +- doc/manual/src/command-ref/nix-channel.md | 6 +++--- doc/manual/src/package-management/basic-package-mgmt.md | 4 ++-- docker.nix | 2 +- lix/libcmd/common-eval-args.cc | 2 +- lix/libexpr/eval-settings.cc | 2 +- lix/nix/nix.md | 2 +- tests/unit/libcmd/args.cc | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/manual/src/command-ref/nix-build.md b/doc/manual/src/command-ref/nix-build.md index e220e77ca..6fda6a2f9 100644 --- a/doc/manual/src/command-ref/nix-build.md +++ b/doc/manual/src/command-ref/nix-build.md @@ -58,7 +58,7 @@ $ nix-build flake:nixpkgs -A firefox $ nix-build flake:github:NixOS/nixpkgs/release-23.11 -A firefox ``` -Finally, for legacy reasons, if a path starts with `channel:`, the rest of the argument is interpreted as the name of a *nixpkgs* channel tarball to fetch from `https://nixos.org/channels/$CHANNEL_NAME/nixexprs.tar.xz`. +Finally, for legacy reasons, if a path starts with `channel:`, the rest of the argument is interpreted as the name of a *nixpkgs* channel tarball to fetch from `https://channels.nixos.org/$CHANNEL_NAME/nixexprs.tar.xz`. This is a **hard coded URL** pattern and is *not* related to the subscribed channels managed by the [nix-channel](./nix-channel.md) command. > **Note**: any of the special syntaxes may always be disambiguated by prefixing the path. diff --git a/doc/manual/src/command-ref/nix-channel.md b/doc/manual/src/command-ref/nix-channel.md index 8111238c9..a38e58df1 100644 --- a/doc/manual/src/command-ref/nix-channel.md +++ b/doc/manual/src/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) @@ -77,9 +77,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/src/package-management/basic-package-mgmt.md b/doc/manual/src/package-management/basic-package-mgmt.md index 1c31e3516..f7cb37161 100644 --- a/doc/manual/src/package-management/basic-package-mgmt.md +++ b/doc/manual/src/package-management/basic-package-mgmt.md @@ -41,7 +41,7 @@ install Lix. If this is not the case for some reason, you can add it as follows: ```console -$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable +$ nix-channel --add https://channels.nixos.org/nixpkgs-unstable $ nix-channel --update ``` @@ -49,7 +49,7 @@ $ nix-channel --update > > On NixOS, you’re automatically subscribed to a NixOS channel > corresponding to your NixOS major release (e.g. -> ). A NixOS channel is identical +> ). A NixOS channel is identical > to the Nixpkgs channel, except that it contains only Linux binaries > and is updated only if a set of regression tests succeed. diff --git a/docker.nix b/docker.nix index 1f350f9bd..9171efc7e 100644 --- a/docker.nix +++ b/docker.nix @@ -8,7 +8,7 @@ tag ? "latest", bundleNixpkgs ? true, channelName ? "nixpkgs", - channelURL ? "https://nixos.org/channels/nixpkgs-unstable", + channelURL ? "https://channels.nixos.org/nixpkgs-unstable", extraPkgs ? [ ], maxLayers ? 100, nixConf ? { }, diff --git a/lix/libcmd/common-eval-args.cc b/lix/libcmd/common-eval-args.cc index 4eff8f904..eee525ce6 100644 --- a/lix/libcmd/common-eval-args.cc +++ b/lix/libcmd/common-eval-args.cc @@ -113,7 +113,7 @@ MixEvalArgs::MixEvalArgs() ``` -I nixpkgs=channel:nixos-21.05 - -I nixpkgs=https://nixos.org/channels/nixos-21.05/nixexprs.tar.xz + -I nixpkgs=https://channels.nixos.org/nixos-21.05/nixexprs.tar.xz ``` You can also fetch source trees using [flake URLs](./nix3-flake.md#url-like-syntax) and add them to the diff --git a/lix/libexpr/eval-settings.cc b/lix/libexpr/eval-settings.cc index ea664692f..6cddff707 100644 --- a/lix/libexpr/eval-settings.cc +++ b/lix/libexpr/eval-settings.cc @@ -82,7 +82,7 @@ bool EvalSettings::isPseudoUrl(std::string_view s) std::string EvalSettings::resolvePseudoUrl(std::string_view url) { if (url.starts_with("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/lix/nix/nix.md b/lix/nix/nix.md index c7bee000f..b7317525e 100644 --- a/lix/nix/nix.md +++ b/lix/nix/nix.md @@ -222,7 +222,7 @@ $ nix build 'nixpkgs#firefox' # from flake.nix $ nix build -f flake:nixpkgs firefox # from default.nix in the flake directory; ignores flake.nix altogether ``` -Finally, for legacy reasons, if a *fileish* starts with `channel:`, the rest of the argument is interpreted as the name of a channel to fetch from `https://nixos.org/channels/$CHANNEL_NAME/nixexprs.tar.gz`. +Finally, for legacy reasons, if a *fileish* starts with `channel:`, the rest of the argument is interpreted as the name of a channel to fetch from `https://channels.nixos.org/$CHANNEL_NAME/nixexprs.tar.gz`. This is a **hard coded URL** pattern and is *not* related to the subscribed channels managed by the [nix-channel](../nix-channel.md) command. diff --git a/tests/unit/libcmd/args.cc b/tests/unit/libcmd/args.cc index a9c0f4ed4..d5adc61de 100644 --- a/tests/unit/libcmd/args.cc +++ b/tests/unit/libcmd/args.cc @@ -13,7 +13,7 @@ #include "lix/libutil/types.hh" constexpr std::string_view INVALID_CHANNEL = "channel:example"; -constexpr std::string_view CHANNEL_URL = "https://nixos.org/channels/example/nixexprs.tar.xz"; +constexpr std::string_view CHANNEL_URL = "https://channels.nixos.org/example/nixexprs.tar.xz"; namespace nix {