New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "nix build -f /dev/stdin" #2669

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@volth
Copy link
Contributor

volth commented Feb 7, 2019

The idea is to allow Nix code in heredoc

Example:

nix build -f /dev/stdin <<'EOF'
let
  inherit (import <nixpkgs> {}) lib buildGoPackage;
in buildGoPackage {
  ...
}
EOF

Discussion:

https://discourse.nixos.org/t/nix-shell-nix-build-and-heredoc/2042

fix "nix build -f /dev/stdin"
The idea is to allow Nix code in heredoc

Example:

nix build -f /dev/stdin <<'EOF'
let
  inherit (import <nixpkgs> {}) lib buildGoPackage;
in buildGoPackage {
  ...
}
EOF

Discussion:

https://discourse.nixos.org/t/nix-shell-nix-build-and-heredoc/2042
@nixos-discourse

This comment has been minimized.

Copy link

nixos-discourse commented Feb 7, 2019

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/nix-shell-nix-build-and-heredoc/2042/7

@@ -577,7 +581,10 @@ Expr * EvalState::parseExprFromFile(const Path & path)

Expr * EvalState::parseExprFromFile(const Path & path, StaticEnv & staticEnv)
{
return parse(readFile(path).c_str(), path, dirOf(path), staticEnv);
if (path == "/dev/stdin")

This comment has been minimized.

@aszlig

aszlig Feb 9, 2019

Member

This is already handled by nix-build -, so we don't need to special-case this, see EvalState::parseStdin and instead just use the same implementation for nix build.

This comment has been minimized.

@volth

volth Feb 9, 2019

Author Contributor

wow, nice find
nix build is less usable anyway, it does not print the results (#2622)

This comment has been minimized.

@LnL7

LnL7 Feb 9, 2019

Member

#2583 does this for all commands that take the -f flag.

@nixos-discourse

This comment has been minimized.

Copy link

nixos-discourse commented Feb 9, 2019

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/nix-shell-nix-build-and-heredoc/2042/8

@volth volth closed this Feb 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment