作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想从 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;
}
) {};
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
最佳答案
正如我在 IRC 上被告知的那样:
>nix-prefetch-git https://github.com/ghcjs/ghcjs-dom
Initialized empty Git repository in /tmp/user/1000/git-checkout-tmp-uxoKqy9s/git-export/.git/
remote: Counting objects: 1070, done.
remote: Compressing objects: 100% (236/236), done.
remote: Total 1070 (delta 858), reused 932 (delta 829), pack-reused 0
Receiving objects: 100% (1070/1070), 580.67 KiB | 911.00 KiB/s, done.
Resolving deltas: 100% (858/858), done.
From https://github.com/ghcjs/ghcjs-dom
* branch HEAD -> FETCH_HEAD
Switched to a new branch 'fetchgit'
git revision is 8b9c64e78e838de95ef1b61f15c0bd7068d45d84
git human-readable version is -- none --
Commit date is 2015-06-08 03:53:22 +1200
removing `.git'...
hash is d05d04cad4aea829dddcf341ed4656d9828713d271f15c94414a74041188bac8
path is /nix/store/kcgbwampbp7qcyxqp4ag8rx2prxnsc19-git-export
d05d04cad4aea829dddcf341ed4656d9828713d271f15c94414a74041188bac8
关于nix - nixpkgs.fetchgit中的sha256是什么意思?值(value)从何而来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31659527/
我正在尝试使用 fetchgit 从我实验室的私有(private) GitLab 服务器下载源代码库,该服务器当前自行签署其 SSL 证书。 default.nix: with (import {
我是一名优秀的程序员,十分优秀!