Currently, even for the unstable channel, the version of Julia is only 1.3. I need the latest release 1.5.1.
The method is not so straight forward because of the FHS problem. And it is better to define the latest Julia package in configure.nix, which is a more nix way.
I copy the nix file of Julia 1.3 and change the corresponding lines (i.e., the file link and sha256). The patches of Julia 1.3 is also relavent. I just place the two patch files and the modified default.nix(originally 1.3.nix) in /etc/nixos/pkgs/julia_1_5/, and add a line in configure.nix.
Then by running sudo nixos-rebuild switch, the latest Julia is installed into my system-wise path.
One more thind I did is that I disabled the check in the default.nix.