I copied and adapted an example from the documentation on how to use the fetchGit
fetcher.
{ stdenv, fetchgit }:
stdenv.mkDerivation {
name = "simple-dlna-browser";
src = fetchgit {
url = "https://github.com/javier-lopez/learn.git";
sparseCheckout = [
"sh/tools/simple-dlna-browser"
];
sha256 = "0000000000000000000000000000000000000000000000000000";
};
installPhase = ''
mkdir $out/bin
chmod +x sh/tools/simple-dlna-browser
cp sh/tools/simple-dlna-browser $out/bin/
'';
}
But it fails
$ nix-build simple-dlna-browser.nix
error: cannot evaluate a function that has an argument without a value ('stdenv')
Nix attempted to evaluate a function as a top level expression; in
this case it must have its arguments supplied either by default
values, or passed explicitly with '--arg' or '--argstr'. See
https://nixos.org/manual/nix/stable/expressions/language-constructs.html#functions.
at /home/nixos/nixos/derivations/scripts/simple-dlna-browser.nix:1:3:
1| { stdenv, fetchgit }:
| ^
2|
So I went to the nix-build
documentation and nix-instantiate
documentation, but it doesn’t explain which parameters it passes when evaluating the expression. I assume pkgs
but what else? Is this documented somewhere?