If I have a command that accesses the internet and downloads a bunch of files into a folder, but I know that the hash of the contents of the folder is constant, is thery anyway to convince git that it is pure?
For example: ./run.sh downloads libs/foo and libs/bar which are listed in libs.lock, from the internet.
I know that for a given libs.lock, the hash of all files in libs/* will be constant.
Is there anyway to convince Nix that this is pure? Like specifiying a sha256 argument for libs folder?
You’re saying buildInputs and nativeBuildInputs are appearing in PATH when outputHash[Algo] are undefined, but not when outputHash[Algo] are defined?
If that’s what you’re seeing in your build env let us know your Nix version, Nix invocation/args, and your expression; because you might have found a bug in the new 2.10 release.
Also just to clear this up if the above isn’t the case : are you saying “a command I usually run in a devShell has a different PATH than the package builder” - because would be expected.
Though what gets changed when using a FOD is, that a FOD doesn’t get rebuild, if it already exists.
So after you built and then change something and rebuild again, nothing changes, as nix things it already has something with that hash.
You always need to update the hash.
That’s why we usually avoid FODs in the “main” derivation and try to use them only for the source or deps and copy them into place in the “main” derivation.
@Growpotkin I’m using home-manager and adding the derivation to home.packages. I expected whatever’s in $out/bin to be symlinked to ~/.nix-profile/bin.
@NobbZ I changed the pname of the derivation to make sure that a previous version is not getting referenced.
In case it helps:
❯ nix --version
nix (Nix) 2.8.1
Here are the full .nix files that I used.
In this case, $out/bin/vue-language-server doesn’t get symlinked to ~/.nix-profile/bin:
Yarn is kind of a shit show with Nix unfortunately but you can definitely get this to work.
I see a pretty glaring difference in these builds though that will explain why bin/* isn’t showing up: did you check to see if it exists? cp -r is probably biting you.