You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How does one actually build nixStatic without a full installation of Nix, such as with the Nix official docker image? It'd be nice to do a multi-stage Docker build like so:
FROM docker.io/nixos/nix AS nix-static-builder
RUN nix --extra-experimental-features "flakes nix-command" build -o /tmp/nix nixpkgs#nixStatic
FROM alpine
COPY --from=nix-static-builder /tmp/nix/bin/nix /usr/bin/nix
Also, is there any predictable URL to grab the static binary besides directly from Hydra? This seems to work for me:
nix run "nixpkgs#curl" -- -L https://hydra.nixos.org/job/nix/maintenance-$(nix --version | nix run "nixpkgs#gawk" -- '{print $3}' | cut -d'.' -f1-2)/buildStatic.nix.$(nix run "nixpkgs#busybox" -- arch)-linux/latest/download-by-type/file/binary-dist -o /nix-bin \
&& chmod +x /nix-bin
😄
Steps To Reproduce
Steps to reproduce the behavior:
Attempt to build nixStatic without downloading from the binary cache, i.e. docker run -it --rm docker.io/nixos/nix nix --extra-experimental-features 'nix-command flakes' build -o /tmp/nix nixpkgs#nixStatic
My laptop running NixOS seems to build it just fine -- but I suspect it's pulling down from the binary cache
Build log
Build Log
(I can get the entire log if desired/needed -- I don't think it's necessary for this example)
❯ docker run -it --rm docker.io/nixos/nix nix --extra-experimental-features 'nix-command flakes' build -o /tmp/nix nixpkgs#nixStatic
error: builder for '/nix/store/28d5l059yypca26g7iria6yixg70q4rp-nix-static-x86_64-unknown-linux-musl-2.24.10.drv' failed with exit code 2;
last 25 log lines:
> AR src/libmain/libnixmain.a
> LD src/libflake/libnixflake.a
> AR src/libfetchers/libnixfetchers.a
> AR src/libflake/libnixflake.a
> LD src/libcmd/libnixcmd.a
> LD tests/unit/libutil-support/libnixutil-test-support.a
> AR tests/unit/libutil-support/libnixutil-test-support.a
> LD src/libutil-c/libnixutilc.a
> AR src/libutil-c/libnixutilc.a
> LD tests/unit/libstore-support/libnixstore-test-support.a
> LD src/libstore-c/libnixstorec.a
> AR src/libstore-c/libnixstorec.a
> LD tests/unit/libexpr-support/libnixexpr-test-support.a
> AR tests/unit/libexpr-support/libnixexpr-test-support.a
> LD src/libexpr-c/libnixexprc.a
> AR tests/unit/libstore-support/libnixstore-test-support.a
> LD tests/unit/libutil/libnixutil-tests
> AR src/libcmd/libnixcmd.a
> AR src/libexpr-c/libnixexprc.a
> LD src/libexpr/libnixexpr.a
> AR src/libexpr/libnixexpr.a
> LD src/libstore/libnixstore.a
> AR src/libstore/libnixstore.a
> make: /nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash: Argument list too long
> make: *** [mk/lib.mk:85: src/nix/nix] Error 127
For full logs, run 'nix log /nix/store/28d5l059yypca26g7iria6yixg70q4rp-nix-static-x86_64-unknown-linux-musl-2.24.10.drv'.
How does one actually build
nixStatic
without a full installation of Nix, such as with the Nix official docker image? It'd be nice to do a multi-stage Docker build like so:Also, is there any predictable URL to grab the static binary besides directly from Hydra? This seems to work for me:
😄
Steps To Reproduce
Steps to reproduce the behavior:
Attempt to build
nixStatic
without downloading from the binary cache, i.e.docker run -it --rm docker.io/nixos/nix nix --extra-experimental-features 'nix-command flakes' build -o /tmp/nix nixpkgs#nixStatic
My laptop running NixOS seems to build it just fine -- but I suspect it's pulling down from the binary cache
Build log
Build Log
(I can get the entire log if desired/needed -- I don't think it's necessary for this example)
Additional context
Metadata
Notify maintainers
@edolstra
@lovesegfault
@Artturin
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: