Commit dd36dc0a by Bruno Bzeznik

Continued phylodb install into the container

parent 1218c124
#!/usr/bin/env bash
nixos-container start phylodb
source_dir=$1
if [ "$source_dir" = "" ]
then
echo "usage: $0 <phylodb_source_directory>"
exit 1
fi
container=phylodb
run() {
nixos-container run $container -- $*
}
# Main setup
nixos-container start $container
init_script=`nix-store --add store/init.sh`
nixos-container run phylodb -- bash $init_script
source_dir=`nix-store --add $source_dir`
run bash $init_script
run mkdir -p /var/lib/phyloalps/phylodb
run cp -a $source_dir/* /var/lib/phyloalps/phylodb/
......@@ -3,47 +3,48 @@
containers.phylodb =
{ config =
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
coreutils
findutils
su
vim
postgresql
postgis
gdal
geos
proj
sass
traceroute
{
environment.systemPackages = with pkgs; [
coreutils
findutils
su
vim
postgresql
postgis
gdal
geos
proj
sass
traceroute
git
(python36.withPackages(ps: with ps; [pip virtualenv psycopg2 urllib3 requests]))
];
];
networking.nat.enable = true;
services.httpd.enable = true;
services.httpd.adminAddr = "gridmaster@univ-grenoble-alpes.fr";
services.openssh.enable = true;
services.postgresql = {
enable = true;
package = pkgs.postgresql;
authentication = "local all all ident";
extraPlugins = [ pkgs.postgis ];
initialScript = pkgs.writeText "backend-initScript" ''
CREATE USER phyloalps WITH PASSWORD 'phyloalps';
CREATE DATABASE browser_db OWNER phyloalps;
CREATE DATABASE editor_db OWNER phyloalps;
'';
};
system.activationScripts = {
django_init = {
text = ''
if [ \! -d /var/lib/django ]
then
mkdir /var/lib/django
fi
'';
deps = [];
};
};
services.httpd.enable = true;
services.httpd.adminAddr = "gridmaster@univ-grenoble-alpes.fr";
services.openssh.enable = true;
services.postgresql = {
enable = true;
package = pkgs.postgresql;
authentication = "local all all ident";
extraPlugins = [ pkgs.postgis ];
initialScript = pkgs.writeText "backend-initScript" ''
CREATE USER phyloalps WITH PASSWORD 'phyloalps';
CREATE DATABASE browser_db OWNER phyloalps;
CREATE DATABASE editor_db OWNER phyloalps;
'';
};
system.activationScripts = {
django_init = {
text = ''
if [ \! -d /var/lib/django ]
then
mkdir /var/lib/django
fi
'';
deps = [];
};
};
};
};
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment