nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

Warning when running nix-darwin

Open arximboldi opened this issue 5 years ago • 4 comments

I keep getting this warning:

warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring

This is a fresh install on MacOS Sierra, using the installer procedure. Is this a sympton that I did something wrong? How do I get rid of such warning?

arximboldi avatar May 30 '19 11:05 arximboldi

It's related to #140, multiple paths are added for compatibility with both the single and multi-user install. But nix complains if one of the defined search paths does not exist.

LnL7 avatar May 31 '19 21:05 LnL7

FYI, see my comment here on how to reset your NIX_PATH to remove this warning.

Note my caveat that updating nix.nixPath and running darwin-rebuild switch for some reason does not update the NIX_PATH environment variable until you source your setEnvironment script.

ericpashman avatar Dec 20 '19 02:12 ericpashman

Based on @ericpashman's linked response, this is what I went with:

{
nix.nixPath = pkgs.lib.mkForce [{
    darwin-config = builtins.concatStringsSep ":" [
      "$HOME/.nixpkgs/darwin-configuration.nix"
      "$HOME/.nix-defexpr/channels"
    ];
  }];
}

Seems to work.

kubukoz avatar Dec 27 '20 04:12 kubukoz

Thanks @kubukoz , your solution works for me on latest MacOS big sur.

Eason0210 avatar Sep 13 '21 05:09 Eason0210