Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nixpacks Feature Request,Support setting nix image source address #1110

Open
mutou981 opened this issue May 22, 2024 · 2 comments
Open

Nixpacks Feature Request,Support setting nix image source address #1110

mutou981 opened this issue May 22, 2024 · 2 comments

Comments

@mutou981
Copy link

Feature request

In China, accessing nix addresses is very slow and requires a mirror address access

image
...
#8 3372.3 copying path '/nix/store/h8d2j0prdf7pnpgyrgkxrrbfwnmxbq6y-binutils-wrapper-2.40' from 'https://cache.nixos.org'...
#8 4545.9 copying path '/nix/store/yfaywdajl7wr612khypmds6rd69pgpdw-icu4c-73.2-dev' from 'https://cache.nixos.org'...
#8 4699.9 copying path '/nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2' from 'https://cache.nixos.org'...
#8 8860.1 copying path '/nix/store/zlzz2z48s7ry0hkl55xiqp5a73b4mzrg-gcc-wrapper-12.3.0' from 'https://cache.nixos.org'...
#8 8860.7 copying path '/nix/store/bbxdw4rgwwl3gnajri82yidr1nlsfskf-stdenv-linux' from 'https://cache.nixos.org'...
...

These copies took 1 hour to execute

I also want to support image source address settings for package management tools such as npm

Motivation

No response

Contribution

No response

@mutou981
Copy link
Author

mutou981 commented May 24, 2024

{setup_copy_cmds}
RUN nix --help
RUN ls /etc/nix
RUN echo 'substituters = https://mirrors.cernet.edu.cn/nix-channels/store https://cache.nixos.org/' > /etc/nix/nix.conf
RUN nix-channel --add https://mirrors.cernet.edu.cn/nix-channels/nixos-22.11 nixos && nix-channel --update
ENV NIX_PATH nixpkgs=https://mirrors.cernet.edu.cn/nix-channels/nixos-22.11/nixexprs.tar.xz
{nix_install_cmds}
{apt_pkgs_str}
{assets_copy_cmd}
...

I tried setting it this way, but it didn't work?

 => [stage-0  1/12] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1716249803@sha256:5ef4d2021c418fcaabb56cea5ea9e24a5fdedfe27f58062d968  0.0s
 => [internal] load build context                                                                                                  0.0s
 => => transferring context: 2.61kB                                                                                                0.0s
 => CACHED [stage-0  2/12] WORKDIR /app/                                                                                           0.0s
 => CACHED [stage-0  3/12] RUN nix --help                                                                                          0.0s
 => CACHED [stage-0  4/12] RUN ls /etc/nix                                                                                         0.0s
 => CACHED [stage-0  5/12] RUN echo 'substituters = https://mirrors.cernet.edu.cn/nix-channels/store https://cache.nixos.org/' >   0.0s
 => CACHED [stage-0  6/12] RUN nix-channel --add https://mirrors.cernet.edu.cn/nix-channels/nixos-22.11 nixos && nix-channel --up  0.0s
 => CACHED [stage-0  7/12] COPY .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix .nixpacks/nixpkgs-bf446f08bff6814b

 > [stage-0  8/12] RUN nix-env -if .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix && nix-collect-garbage -d:
16.76 warning: error: unable to download 'https://github.com/NixOS/nixpkgs/archive/bf446f08bff6814b569265bef8374cfdd3d8f0e0.tar.gz': HTTP error 302 (curl error: SSL connect error); retrying in 304 ms

Still from github pull

@orkunzozturk
Copy link

i face the same problem. download speeds from china are extremely slow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants