我正在尝试使用nix下载并构建一个用golang编写的项目
我的nix文件:
buildGoPackage {
name = "site";
goPackagePath = "git@github.com:username/rep.git";
src = fetchGit{
url = "git@github.com:username/rep.git";
};
}
运行:
nix build -f test3.nix
错误日志:
last 8 log lines:
> unpacking sources
> unpacking source archive /nix/store/l1gsllgg693s46sk7b7qiwbnjysnbbz6-source
> source root is source
> patching sources
> configuring
> building
> Building subPackage git@github.com:user/rep.git
> go: modules disabled by GO111MODULE=off; see 'go help modules'
1条答案
按热度按时间fcipmucu1#
我认为您应该使用
buildGoModule
而不是buildGoPackage
,因为根据the nixpkgs documentation for go,buildGoPackage已被弃用。此外,
buildGoModule
似乎没有设置GO111MODULE=off
。