diff options
author | Lancelot SIX <lsix@lancelotsix.com> | 2016-08-19 09:06:40 +0200 |
---|---|---|
committer | Lancelot SIX <lsix@lancelotsix.com> | 2016-09-02 11:51:21 +0200 |
commit | 5b8072fff6afe5a455d06b8b8f37a6d7e0519986 (patch) | |
tree | 9a4bf5397bbff921b78261cb347357f81801032b /nixos/tests | |
parent | f976fa40a238e9bf78fd1a875dbd2f23318acf6a (diff) | |
download | nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.tar nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.tar.gz nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.tar.bz2 nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.tar.lz nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.tar.xz nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.tar.zst nixlib-5b8072fff6afe5a455d06b8b8f37a6d7e0519986.zip |
postgresql: Fix use with extensions
Fixes #15512 and #16032 With the multi output, postgresql cannot find at runtime what is its basedir when looking for libdir and pkglibdir. This commit fixes that.
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/postgis.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/postgis.nix b/nixos/tests/postgis.nix new file mode 100644 index 000000000000..1dba5c363c09 --- /dev/null +++ b/nixos/tests/postgis.nix @@ -0,0 +1,30 @@ +import ./make-test.nix ({ pkgs, ...} : { + name = "postgis"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ lsix ]; + }; + + nodes = { + master = + { pkgs, config, ... }: + + { + services.postgresql = let mypg = pkgs.postgresql95; in { + enable = true; + package = mypg; + extraPlugins = [ (pkgs.postgis.override { postgresql = mypg; }).v_2_2_1 ]; + initialScript = pkgs.writeText "postgresql-init.sql" + '' + CREATE ROLE postgres WITH superuser login createdb; + ''; + }; + }; + }; + + testScript = '' + startAll; + $master->waitForUnit("postgresql"); + $master->sleep(10); # Hopefully this is long enough!! + $master->succeed("sudo -u postgres psql -c 'CREATE EXTENSION postgis;'"); + ''; +}) |