macos - 如何找到构建 macos/darwin 二进制缓存的 nixpkgs 修订版?

标签 macos haskell devops nix nixos

我想将 nixpkgs 固定到一个非常新的修订版,例如 Haskell LTS-12.9 或其他东西。我想将 nix-build 用于 MacOS(达尔文)构建。

问题是大多数 Haskell 包都没有二进制缓存,并且构建需要很长时间才能完成(在 MacOS 上)。

我如何才能找到“最佳”的 nixpkgs 修订版,该修订版足够新,可以包含我需要的软件版本,但又足够旧,可以用于 Linux 和 MacOS 的二进制缓存?

最佳答案

您可以找到 nixpkgs 的缓存版本 right here on the HowOldIs app.

您可能希望使用 nixpkgs-18.09-darwin 的修订版。或 nixpkgs-unstable .

然后你可以像这样获取 nixpkgs

builtins.fetchGit {
  name = "nixpkgs";
  url = "https://github.com/nixos/nixpkgs.git";
  rev = "6ec64973bc3a48b0c54d11c782e8b88b550a8eab";
  ref = "release-18.09";
})
ref当修订不在默认分支下时需要属性 - 通常是 master .

备注 in the Nix manual描述如下:

Note: It is nice to always specify the branch which a revision belongs to. Without the branch being specified, the fetcher might fail if the default branch changes. Additionally, it can be confusing to try a commit from a non-default branch and see the fetch fail. If the branch is specified the fault is much more obvious.



我想这种行为是受到 Git 协议(protocol)中的一种解决方法的启发,如果我没记错的话,您只能指定 refs 进行获取,而不能指定任意提交。

关于macos - 如何找到构建 macos/darwin 二进制缓存的 nixpkgs 修订版?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52421987/

相关文章:

list - Haskell 惰性求值和带有无限列表的 let-in 表示法

haskell - "symmetric"函数的模式

haskell - 使用 stack 安装 shuffle 库时出错

azure - 如何在 Azure DevOps 中访问其他组织的存储库?

c++ - 人工降低CPU速度或内核数

python - 无法在 Mac OS X 终端上使用 pip 安装 Tweepy

jenkins - Capistrano 和 Jenkins 之间的区别

azure - 与 Service Fabric 和 .Net Framework > 4.5.2 相关的问题

macos - 如何在 Mac 操作系统上安装 docker 手册页

python - mongodb数据库存储在本地硬盘的什么位置?