mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
31 lines
810 B
Nix
31 lines
810 B
Nix
|
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;'");
|
||
|
'';
|
||
|
})
|