ninegua / ic-nix

Build Internet Computer projects with Nix
MIT License
30 stars 3 forks source link

Not able to use the latest release with MacOS M1 #75

Open ravibazz opened 9 months ago

ravibazz commented 9 months ago

Description

I have been trying to use the latest release of ic-nix with mac os M1 and tried all the options listed in the readme still was not able to get it working.

Attaching my nix file here


let
  rev = "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447";
  nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
  pkgs = import nixpkgs { };
  version = "20231213";
  dfx-env = import (builtins.fetchTarball "https://github.com/ninegua/ic-nix/releases/download/${version}/dfx-env.tar.gz") { version = "${version}"; inherit pkgs; };
in
dfx-env.overrideAttrs (old: {
  nativeBuildInputs = with pkgs; old.nativeBuildInputs ++
    [ rustup pkg-config openssl protobuf cmake cachix killall jq coreutils bc python3Full ];
})

Let me know if I am missing something here.

ninegua commented 5 months ago

Sorry that I didn't notice this question.

The problem seems to be that 20231213 wasn't a valid release tag.

Now that GitHub supports m1 runners, and I just updated the CI to build m1 binaries. So you should be able to do just this to get it working:

{ pkgs ? import <nixpkgs> {} }:
let
  version = "20240413";
  dfx-env = import (builtins.fetchTarball "https://github.com/ninegua/ic-nix/releases/download/${version}/dfx-env.tar.gz") { version = "${version}"; inherit pkgs; };
in
dfx-env.overrideAttrs (old: {
  nativeBuildInputs = with pkgs; old.nativeBuildInputs ++
    [ rustup pkg-config openssl protobuf cmake cachix killall jq coreutils bc python3Full ];
})