From 0f2cd554b4e27985fc0be700d5bbb6ddb066b792 Mon Sep 17 00:00:00 2001 From: oxalica Date: Sun, 10 Dec 2023 00:48:55 +0800 Subject: [PATCH] nix-channel: do not set empty nix-path when disabling channels An empty nix-path in nix.conf will disable NIX_PATH environment variable entirely, which is not necessarily implied by users who want to disable nix channels. NIX_PATH also has some usages in tools like nixos-rebuild or just as user aliases. That change is surprising and debatable, and also caused breakages in nixpkgs-review and user configs. See: - https://github.com/NixOS/nixpkgs/pull/242098/files#r1269891427 - https://github.com/Mic92/nixpkgs-review/issues/343 --- nixos/modules/config/nix-channel.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/modules/config/nix-channel.nix b/nixos/modules/config/nix-channel.nix index a7ca7a5c74a406f..fb1e4ad8269a19d 100644 --- a/nixos/modules/config/nix-channel.nix +++ b/nixos/modules/config/nix-channel.nix @@ -95,8 +95,6 @@ in NIX_PATH = cfg.nixPath; }; - nix.settings.nix-path = mkIf (! cfg.channel.enable) (mkDefault ""); - systemd.tmpfiles.rules = lib.mkIf cfg.channel.enable [ ''f /root/.nix-channels - - - - ${config.system.defaultChannel} nixos\n'' ];