I'm trying to use Nix on Ubuntu 16.04.
After setup, I try to build the following expression:
let
pkgs = import <nixpkgs> {};
stdenv = pkgs.stdenv;
in rec {
scalaEnv = stdenv.mkDerivation rec {
name = "scala-env";
shellHook = ''
alias cls=clear
'';
CLANG_PATH = pkgs.clang + "/bin/clang";
CLANGPP_PATH = pkgs.clang + "/bin/clang++";
buildInputs = with pkgs; [
stdenv
sbt
openjdk
boehmgc
libunwind
re2
clang
zlib
ammonite
];
};
}
But this ends in the error:
*** Downloading ‘https://cache.nixos.org/nar/022mrfa98hxccsn9znr9z9s7sh3kfc5wzvgfx45x5drcz9wq3wyv.nar.xz’ to ‘/nix/store/y1scdckyi7ij30771rl1pdq4s9gj683a-sbt-1.0.1’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 50.0M 100 50.0M 0 0 12.5M 0 0:00:04 0:00:04 --:--:-- 10.7M
building path(s) ‘/nix/store/9xykkj5z6szrwamji3gshylxca092nv9-scala-env’
unpacking sources
variable $src or $srcs should point to the source
builder for ‘/nix/store/wg0kd6z5kik46xza5xsdqw4yf10ifksv-scala-env.drv’ failed with exit code 1
error: build of ‘/nix/store/wg0kd6z5kik46xza5xsdqw4yf10ifksv-scala-env.drv’ failed
The command '/bin/sh -c $nixenv && nix-build scala-default.nix -A scalaEnv' returned a non-zero code: 100
Note that /bin/sh -c $nixenv
is just trying to set up the nix environment - I can post more details if that is helpful.
I've built a very similar expression in the past on another system - I'm not sure what could be going wrong on this system - how might one go about debugging this?