[Nix-dev] R package name can't be used in variable substitution?

Jeffrey David Johnson jefdaj at gmail.com
Wed May 20 20:39:34 CEST 2015


I put together an example package that generates a bash script:

# default.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "varSubTest";
  src = ./.;
  inherit R; rByAnotherName = R;
  builder = ./builder.sh;
}

# builder.sh
#!/usr/bin/env bash
source $stdenv/setup
mkdir -p $out/bin
substituteAll $src/varSubTest.sh $out/bin/varSubTest
chmod +x $out/bin/varSubTest

# varSubTest.sh
#!/usr/bin/env bash
echo "R is substituted with @R@"
echo "rByAnotherName is substituted with @rByAnotherName@"

If you run `nix-build && ./result/bin/varSubTest`, you'll see that @R@ is skipped.
Is there a restriction that single uppercase letters can't be used as variable names?
Jeff


More information about the nix-dev mailing list