nix-community / docker-nix

Docker image for nix [maintainer=@zimbatm] [status=deprecated]
https://hub.docker.com/r/nixorg/nix/
Apache License 2.0
38 stars 9 forks source link

Building a "custom" yarn doesn't work #26

Closed pmiddend closed 4 years ago

pmiddend commented 4 years ago

I have the following shell.nix:

with import <nixpkgs> {};
pkgs.mkShell {
  buildInputs = [(yarn.override { nodejs = nodejs-12_x; })];
}

And I'm pinning my dependencies by setting NIX_PATH accordingly. This fails with messages like:

building '/nix/store/fwzhc2811n5v4fkgk716ny8zgalmfkq2-yarn-1.21.1.drv'...
/nix/store/532j064yymbq3j7zd6qlx4yh9grs9wcx-stdenv-linux/setup: line 795: /build/env-vars: No such file or directory
unpacking sources
/nix/store/532j064yymbq3j7zd6qlx4yh9grs9wcx-stdenv-linux/setup: line 795: /build/env-vars: No such file or directory
unpacking source archive /nix/store/3wqwpzjk15jyzkgigvscgqn16zlvb8wr-source
source root is source
find: '/build/..': No such file or directory

Am I doing something wrong?

You can actually test this very easily. Just save this to a Dockerfile:

FROM nixorg/nix:2

ENV NIX_PATH nixpkgs=https://github.com/nixos/nixpkgs/archive/bea1a232c615aba177e0ef56600d5f847ad3bbd9.tar.gz
RUN nix-shell -p "yarn.override { nodejs = nodejs-12_x; }"

And then just docker build -t mytest .

Edit: Note that the official Nix Docker image doesn't have this problem.

zimbatm commented 4 years ago

Indeed I can reproduce the issue. I actually switched to using nixpkgs/nix from the nix-community/docker-nixpkgs project. Going forwards this will be the better supported method.

pmiddend commented 4 years ago

Okay, we've switched images now. Maybe you should mention that you're not really maintaining/using this image anymore?

zimbatm commented 4 years ago

maybe :)