我想从 github 添加一个包,就像在下面的示例中一样,但我不知道在哪里可以获得任何给定 github 源所需的 sha256 哈希(如下所示)。
有人可以解释一下 sha256 来自哪里,我怎样才能获得给定 github 代码库的 sha256 值?
ghcjs-jquery = self.callPackage ({ mkDerivation, data-default, ghcjs-base, ghcjs-dom, text }:
mkDerivation {
pname = "ghcjs-jquery";
version = "0.1.0.0";
src = nixpkgs.fetchgit {
url = git://github.com/ghcjs/ghcjs-jquery;
rev = "c5eeeafcf81c0d3237b8b9fcb98c4b3633a1297f";
sha256 = "3b2de54224963ee17857a9737b65d49edc423e06ad7e9c9b85d9f69ca923676a";
};
buildDepends = [
data-default ghcjs-base ghcjs-dom text
];
jailbreak = true;
license = null;
}
) {};
https://github.com/ryantrinkle/try-reflex/blob/ghcjs-improved-base/default.nix#L49
ps,这是我在 IRC 上得到的答案:
joco42> what does this sha256 attribute mean in this nix expression ? https://github.com/ryantrinkle/try-reflex/blob/ghcjs-improved-base/default.nix#L49
8:24 PM <joco42> where does it come from ?
8:24 PM <pikajude> that's the sha256 hash of that git checkout
8:25 PM → obadz and ldng joined ⇐ obadz- quit
8:29 PM <joco42> pikajude: ok, cool how can i get that ?
8:30 PM <pikajude> nix-prefetch-git in the nix-prefetch-scripts package
8:30 PM <joco42> many thanks pikajude