From d97d311ddfbb656bc4ccd1e81f9059d0ddea8c8d Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 24 Apr 2025 20:10:54 -0400 Subject: [PATCH] Emit a warning about channel deprecation. --- doc/manual/source/command-ref/nix-channel.md | 6 ++++++ src/nix-channel/nix-channel.cc | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/doc/manual/source/command-ref/nix-channel.md b/doc/manual/source/command-ref/nix-channel.md index 8b58392b7..bc0a90b11 100644 --- a/doc/manual/source/command-ref/nix-channel.md +++ b/doc/manual/source/command-ref/nix-channel.md @@ -8,6 +8,12 @@ # Description +> **Warning** +> +> nix-channel is deprecated in favor of flakes in Determinate Nix. +> For a guide on Nix flakes, see: . +> For details and to offer feedback on the deprecation process, see: . + Channels are a mechanism for referencing remote Nix expressions and conveniently retrieving their latest version. The moving parts of channels are: diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index c0baa4aa2..a6ca6f711 100644 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -164,6 +164,11 @@ static void update(const StringSet & channelNames) static int main_nix_channel(int argc, char ** argv) { + warn( + "nix-channel is deprecated in favor of flakes in Determinate Nix. \ +For a guide on Nix flakes, see: https://zero-to-nix.com/. \ +For details and to offer feedback on the deprecation process, see: https://github.com/DeterminateSystems/nix-src/issues/34."); + { // Figure out the name of the `.nix-channels' file to use auto home = getHome();