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
On the same page you have another shellHook example that causes the same issue.
Removing the + resolves the syntax error, but I want to confirm if this is the correct approach or if there's a better way to set environment variables.
Thanks!
The text was updated successfully, but these errors were encountered:
The + symbol is shown because we use the unified format to indicate added lines in our examples. This symbol should not be included in your input to nix. Removing the + and using the line GREETING = "Hello, Nix!"; is indeed the correct way to set the environment variable.
You are probably not the first person to encounter this issue. We will consider adding a short explanation to our examples to prevent confusion in the future.
If you have any further questions or run into more issues, feel free to ask. We're here to help!
Description
I encountered a syntax error while trying to set an environment variable in nix-shell using the your provided example:
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";
pkgs = import nixpkgs { config = {}; overlays = []; };
in
pkgs.mkShellNoCC {
packages = with pkgs; [
cowsay
lolcat
];
}
Error Message
`error: syntax error, unexpected '+'
`
On the same page you have another shellHook example that causes the same issue.
Removing the + resolves the syntax error, but I want to confirm if this is the correct approach or if there's a better way to set environment variables.
Thanks!
The text was updated successfully, but these errors were encountered: