Jump to content

FAQ/Pinning Nixpkgs: Difference between revisions

Missing `ref` attribute from `fetchGit` invocation
imported>Hyperfekt
(→‎Nix 2.0 onwards: hide outdated info about fetchGit being faster)
imported>Onetom
(Missing `ref` attribute from `fetchGit` invocation)
Line 28: Line 28:
   # Commit hash for nixos-unstable as of 2018-09-12
   # Commit hash for nixos-unstable as of 2018-09-12
   # `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
   # `git ls-remote https://github.com/nixos/nixpkgs-channels nixos-unstable`
  ref = "refs/heads/nixpkgs-unstable";
   rev = "ca2ba44cab47767c8127d1c8633e2b581644eb8f";
   rev = "ca2ba44cab47767c8127d1c8633e2b581644eb8f";
}) {}
}) {}
</syntaxhighlight>
If the <code>ref</code> attribute is omitted, we get an error like this:
<syntaxhighlight>
fatal: not a tree object: 3d70d4ba0b6be256974910e635fadcc0e9579b2a
error: while evaluating the attribute 'buildInputs' of the derivation 'nix-shell' at /nix/store/b93cq865x6qxpn4dw9ivrk3yjcsm8r97-nixos-19.09/pkgs/build-support/mkshell/default.nix:28:3:
while evaluating 'getOutput' at /nix/store/b93cq865x6qxpn4dw9ivrk3yjcsm8r97-nixos-19.09/lib/attrsets.nix:464:23, called from undefined position:
while evaluating anonymous function at /nix/store/b93cq865x6qxpn4dw9ivrk3yjcsm8r97-nixos-19.09/pkgs/stdenv/generic/make-derivation.nix:142:17, called from undefined position:
program 'git' failed with exit code 128
</syntaxhighlight>
</syntaxhighlight>


Anonymous user