Skip to content
Discussion options

You must be logged in to vote

ah....

config.drv.__structuredAttrs = true;

Apparently structuredAttrs disables passAsFile??

I was actually unaware of this. I thought I tested this...

nix-repl> :bl pkgs.stdenv.mkDerivation { name = "testdrv"; testfile = "test content"; passAsFile = [ "testfile" ]; buildCommand = ''cp "$testfilePath" "$out"''; }

This derivation produced the following outputs:
  ./repl-result-out -> /nix/store/nmwl3zaiwrsf1qq8pzyk04viphy1zpn9-testdrv

nix-repl>

nix-repl> :bl pkgs.stdenv.mkDerivation { name = "testdrv"; testfile = "test content"; passAsFile = [ "testfile" ]; __structuredAttrs = true; buildCommand = ''cp "$testfilePath" "$out"''; }
error: Cannot build '/nix/store/qrsp8b4a0pwfkygsmq9b283q7…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@FluxZA
Comment options

@BirdeeHub
Comment options

@BirdeeHub
Comment options

@FluxZA
Comment options

@BirdeeHub
Comment options

Answer selected by FluxZA
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants