Skip to content

Commit ddb9525

Browse files
authored
Merge pull request #176 from json-scada/master
Fix syntax error in dev.nix file.
2 parents 397d6f3 + ad27e31 commit ddb9525

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

.idx/dev.nix

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
mongoimport --db json_scada --collection realtimeData --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_data.json &&
8585
mongoimport --db json_scada --collection processInstances --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_process_instances.json &&
8686
mongoimport --db json_scada --collection users --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_users.json &&
87-
mongosh json_scada --eval \"db.realtimeData.updateMany({_id:{$gt:0}},{$set:{dbId:'demo'}})\"
8887
";
8988
init-postgresql = "
9089
mkdir -p ~/postgres &&

platform-nix-idx/dev.nix

+22-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
channel = "stable-23.11"; # or "unstable"
66

77
# Use https://search.nixos.org/packages to find packages
8-
packages = [
8+
packages = [
9+
pkgs.postgresql_15_jit
10+
pkgs.postgresql15Packages.timescaledb
11+
pkgs.postgresql15Packages.timescaledb_toolkit
912
pkgs.util-linux.bin
1013
pkgs.dotnet-sdk_8
1114
pkgs.vscode-extensions.ms-dotnettools.csharp
@@ -30,14 +33,14 @@
3033
# pkgs.nodePackages.nodemon
3134
];
3235

33-
services.postgres = {
34-
extensions = [
35-
"timescaledb"
36-
"timescaledb_toolkit"
37-
];
38-
enable = true;
39-
};
40-
# services.mongodb.enable = true;
36+
#services.postgres = {
37+
# extensions = [
38+
# "timescaledb"
39+
# "timescaledb_toolkit"
40+
# "pgvector"
41+
# ];
42+
# enable = true;
43+
#};
4144
services.docker.enable = true;
4245

4346
# Sets environment variables in the workspace
@@ -70,8 +73,6 @@
7073
workspace = {
7174
# Runs when a workspace is first created
7275
onCreate = {
73-
# Example: install JS dependencies from NPM
74-
# npm-install = "npm install";
7576
init-mongodb = "
7677
mkdir -p ~/mongodb/var/lib/mongo/ &&
7778
mkdir -p ~/mongodb/var/log/mongodb/ &&
@@ -83,11 +84,17 @@
8384
mongoimport --db json_scada --collection realtimeData --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_data.json &&
8485
mongoimport --db json_scada --collection processInstances --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_process_instances.json &&
8586
mongoimport --db json_scada --collection users --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_users.json &&
86-
mongosh json_scada --eval \"db.realtimeData.updateMany({_id:{\$gt:0}},{\$set:{dbId:'demo'}})\" &&
87+
";
88+
init-postgresql = "
89+
mkdir -p ~/postgres &&
90+
initdb -D ~/postgres &&
91+
cp ~/json-scada/platform-nix-idx/postgresql.conf ~/postgres/postgresql.conf &&
92+
cp ~/json-scada/platform-nix-idx/pg_hba.conf ~/postgres/pg_hba.conf &&
93+
/usr/bin/pg_ctl -D /home/user/postgres start &&
94+
/usr/bin/createuser -h localhost -s postgres &&
8795
psql -U postgres -w -h localhost -f ~/json-scada/sql/create_tables.sql template1 &&
8896
psql -U postgres -w -h localhost -f ~/json-scada/sql/metabaseappdb.sql metabaseappdb &&
89-
psql -U postgres -w -h localhost -f ~/json-scada/sql/grafanaappdb.sql grafanaappdb &&
90-
psql -U postgres -w -h localhost -d json_scada -c \"CREATE EXTENSION timescaledb_toolkit;\"
97+
psql -U postgres -w -h localhost -f ~/json-scada/sql/grafanaappdb.sql grafanaappdb
9198
";
9299
build-jsonscada = "cd ~/json-scada/platform-linux && ./build.sh";
93100
};
@@ -96,6 +103,7 @@
96103
# Example: start a background task to watch and re-build backend code
97104
# watch-backend = "npm run watch-backend";
98105
start-mongodb = "/usr/bin/mongod -f ~/json-scada/platform-nix-idx/mongod.conf";
106+
start-supervisor = "(supervisord -c ~/json-scada/platform-nix-idx/supervisord.conf &)";
99107
};
100108
};
101109
};

0 commit comments

Comments
 (0)