Error: The ‘env’ attribute set cannot contain any attributes passed to derivation.
When trying to build from source on a M1 pro macbook using the following command:
nix-shell https://github.com/ninegua/ic-nix/releases/latest/download/dfx-env.tar.gz --arg force true
I get the following error:
error: The ‘env’ attribute set cannot contain any attributes passed to derivation. The following attributes are overlapping: NIX_CFLAGS_COMPILE
(use '--show-trace' to show detailed location information)
Operating system: MacOS verntura 13.2.1 nix-shell version: 2.13.3
Based on the conversation in issue https://github.com/ninegua/ic-nix/issues/38 I also tried the following nix.shell.
{ pkgs ? import <nixpkgs> { } }:
let
ic-nix = pkgs.fetchFromGitHub {
owner = "ninegua";
repo = "ic-nix";
rev = "0c8c6808a88d650b5546a60a073853f6ceae97cc";
sha256 = "sha256-MiK4vw4TLjXN3VH24+yeUvV7Qy2zbtKr5io/lafXjVA=";
};
dfx-env = pkgs.callPackage "${ic-nix}/dfx-env.nix" {
force = true;
inherit pkgs ic-nix;
};
in
dfx-env.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.rustup pkgs.pkg-config pkgs.openssl pkgs.protobuf pkgs.cmake pkgs.cachix pkgs.killall ];
})
but I'm still getting the same error.
The problem is with using nixos (or nixpkgs) unstable channel. For now, you can manually pin a different channel as described here https://github.com/ninegua/ic-nix/issues/38#issuecomment-1468208928
NOTE: If you are on darwin, you may want to use nixpkgs-22.05-darwin instead of nixos-22.11. This is because nixpkgs 22.11 seems to have a problem building python3...
I think it is now safe to try nixpkgs-22.11-darwin since the CI on github has passed.