-
Notifications
You must be signed in to change notification settings - Fork 8
/
devenv.nix
58 lines (51 loc) · 1.66 KB
/
devenv.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ inputs, pkgs, ... }:
let
pkgs-old = import inputs.nixpkgs-old { system = pkgs.stdenv.system; };
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
in
{
packages = [ pkgs.git pkgs.libyaml pkgs.imagemagick pkgs.firefox pkgs-unstable.chromedriver
pkgs.ruby.devEnv pkgs.chromium
];
enterShell = ''
echo This is the devenv shell for the webbrowser ch.oddb.org
git --version
ruby --version
psql --version
'';
env.FREEDESKTOP_MIME_TYPES_PATH = "${pkgs.shared-mime-info}/share/mime/packages/freedesktop.org.xml";
env.ODDB_URL = "127.0.0.1:8012"; # for running the watir spec tests
languages.ruby.enable = true;
languages.ruby.versionFile = ./.ruby-version;
services.postgres = {
enable = true;
package = pkgs-old.postgresql_10;
listen_addresses = "0.0.0.0";
port = 5433;
initialDatabases = [
{ name = "ch_oddb"; }
];
initdbArgs =
[
"--locale=C"
"--encoding=UTF8"
];
initialScript = ''
create role oddb superuser login password null;
create role ch_oddb superuser login password null;
create role postgres superuser login password null;
\connect ch_oddb;
\i ../22:00-postgresql_database-ch_oddb-backup
'';
};
scripts.start_oddb_daemons.exec = ''
set -eux
bundle exec ruby ext/export/bin/exportd &
bundle exec ruby ext/fiparse/bin/fiparsed &
bundle exec ruby ext/meddata/bin/meddatad &
bundle exec ruby ext/refdata/bin/refdatad &
bundle exec ruby ext/swissindex/bin/swissindexd &
bundle exec ruby ext/swissreg/bin/swissregd &
bundle exec rackup --host 127.0.0.1 -p 8012 &
'';
}