Julia2Nix.jl
Julia2Nix.jl copied to clipboard
can not run Julia2Nix successfully on MacBook M1
When I followed the instructions on my MacBook M1 Pro, I got the error messages as below:
warning: input 'nix-filter' has an override for a non-existent input 'nixpkgs' error: attribute 'julia-17-release-aarch64-darwin' missing
at /nix/store/shndcj46cdfmb1kibdjrhvryc7mxksh4-nix/julia2nix/overlays/installApp.nix:19:12:
18| inherit version;
19| inherit (julia-sources."julia-${version}-${system}") pname src;
| ^
20|
Did you mean julia-18-release-aarch64-darwin?
(use '--show-trace' to show detailed location information) /nix/store/19lf3x5r6z169wg98m6m40y8v8fy4bj9-source/direnv_lib.sh:58: /Users/alan/projects/Julia2Nix/.std/julia2nix/devshells/default/shell-profile/entrypoint: No such file or directory
- Only julia-18-release-aarch64-darwin available on aarch64-darwin;
please try https://github.com/JuliaCN/Julia2Nix.jl/blob/main/templates/dev/flake.nix#L27
package = pkgs.julia_bin-18 or package = julia2nix.packages.${system}.julia_18-bin;
instead.
Furthermore, Could you share your flake config here?
Hi GuangTao,
There is only one line of flake configuration in the file ~/.config/nix/nix.conf
experimental-features = nix-command flakes
- Only julia-18-release-aarch64-darwin available on aarch64-darwin; please try https://github.com/JuliaCN/Julia2Nix.jl/blob/main/templates/dev/flake.nix#L27
package = pkgs.julia_bin-18 or package = julia2nix.packages.${system}.julia_18-bin;
instead.![]()
I got the same error as before. It seems that the variable version of Julia is not correct.
Fixed by https://github.com/JuliaCN/Julia2Nix.jl/commit/00d692aed5d2411c234dda58a1dca3bccc30ce41#diff-0aa872778243091e122dbd95590392267ea6e0cf66890d6e1543ed2606e1ee57R27 you can try again.
nix flake lock --update-input julia2nix
nix develop --command julia --version
Notice: Maybe the 1.8 version cannot be used to generate julia2nix.toml under darwin, and the relevant code needs to be updated. PR is welcome
I changed the Julia version in the area of line 14-18 of the file Julia2Nix/nix/julia2nix/devshellProfiles/packages.nix, and I can successfully run the commands you shared above. Before the changes, I got the same error as before.

I changed the Julia version in the area of line 14-18 of the file Julia2Nix/nix/julia2nix/devshellProfiles/packages.nix, and I can successfully run the commands you shared above. Before the changes, I got the same error as before.
![]()
Here is the running results:

Fixed by 00d692a#diff-0aa872778243091e122dbd95590392267ea6e0cf66890d6e1543ed2606e1ee57R27 you can try again.
nix flake lock --update-input julia2nix nix develop --command julia --version
Notice: Maybe the 1.8 version cannot be used to generate julia2nix.toml under darwin, and the relevant code needs to be updated. PR is welcome
Now I can run the Julia2Nix at the root folder level by following the commands you shared. I am curios how could I use the dev template? Is there a light way of using the template for creating a Julia enabled project? Could you please share the guideline of using the template with me?
Thanks!
you can create the template by the flake-init.
https://github.com/JuliaCN/Julia2Nix.jl#default
Thanks for your information. Just test the template on MacBook Pro M1, and got the error message as below.

I didn't add the GR of aarch64-darwin. Please set it to false. https://github.com/JuliaCN/Julia2Nix.jl/blob/main/templates/dev/flake.nix#L35.
Adding multi-platform support is currently a bit of a hassle. I don't have the enough energy to add support for all platforms. I hope there is a complete artifacts solution in the future.
Thank you GuangTao,
Now I am able to run the template devshell very well on aarch64-darwin.

@alan-zhang-22 @GTrunSec is this issue now closed?