mhe*_*rzl 3 postgresql nixos haskell-stack
在nixos上,当试图用我的项目构建时$ stack --nix build,我遇到了以下错误.
$ stack --nix build
...
Linking /run/user/1000/stack25943/postgresql-libpq-0.9.2.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup ...
Configuring postgresql-libpq-0.9.2.0...
setup: The program 'pg_config' is required but it could not be found.
Run Code Online (Sandbox Code Playgroud)
我已经按照nixos手册安装了postgres 并且已经pg_config安装了,如图所示
$ which pg_config
/run/current-system/sw/bin/pg_config
Run Code Online (Sandbox Code Playgroud)
看来堆栈不知道我的pg_config的这个位置.
我如何继续取得$ stack --nix build成功?
您需要将Nix包添加到它正在构建Haskell包的nix-shell环境中.
在stack.yaml:
nix:
packages: [postgresql]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1419 次 |
| 最近记录: |