Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell Stack does not build postgresql-libpq on Nixos

Tags:

After adding postgresql-libpq to my project's cabal file, stack build fails with the following:

Configuring postgresql-libpq-0.9.1.1...
setup: The program 'pg_config' is required but it could not be found.

I'm on Nixos and pg_config is both installed and on my PATH:

$ whereis pg_config
pg_config: /nix/store/5bc6hzqkyw8dpi91sqznd3ik42mllwyz-system-path/bin/pg_config

I'm using stack 1.0.2, and it seems that it won't update even after nixos-rebuild switch --upgrade on the unstable channel. Is this a mistake on my side or is it something else?

like image 907
Marcelo Zabani Avatar asked Sep 20 '16 21:09

Marcelo Zabani


1 Answers

I ran into this issue with stack on nixos, and got past it when the nix block of my stack.yaml had been changed to the following.

nix:
  pure: true
  enable: true
  packages: [ postgresql ]
like image 120
mherzl Avatar answered Oct 03 '22 02:10

mherzl