Skip to content

Commit

Permalink
Merge pull request #177 from json-scada/master
Browse files Browse the repository at this point in the history
Fix errors in dev.nix file.
  • Loading branch information
riclolsen authored Dec 1, 2024
2 parents ddb9525 + 330680a commit 19548c9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
11 changes: 8 additions & 3 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.sudo
pkgs.postgresql_15_jit
pkgs.postgresql15Packages.timescaledb
pkgs.postgresql15Packages.timescaledb_toolkit
Expand All @@ -16,6 +17,7 @@
pkgs.icu
pkgs.gcc
pkgs.gnumake
pkgs.cmake
pkgs.go
pkgs.python311
pkgs.python311Packages.pip
Expand Down Expand Up @@ -44,7 +46,9 @@
services.docker.enable = true;

# Sets environment variables in the workspace
env = { };
env = {
DOTNET_ROOT = "/nix/store/3frycb58lshfmnkjv1rvqqz1s7wyvvck-dotnet-sdk-8.0.101";
};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
Expand Down Expand Up @@ -74,8 +78,9 @@
# Runs when a workspace is first created
onCreate = {
init-mongodb = "
mkdir -p ~/mongodb/var/lib/mongo/ &&
mkdir -p ~/mongodb/var/log/mongodb/ &&
rm -rf ~/.emu/avd
mkdir -p /mnt/ephemeral/mongodb/var/lib/mongo/ &&
mkdir -p /mnt/ephemeral/mongodb/var/log/mongodb/ &&
mongod -f ~/json-scada/platform-nix-idx/mongod.conf &&
mongosh json_scada < ~/json-scada/mongo_seed/a_rs-init.js &&
mongosh json_scada < ~/json-scada/mongo_seed/b_create-db.js &&
Expand Down
11 changes: 8 additions & 3 deletions platform-nix-idx/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.sudo
pkgs.postgresql_15_jit
pkgs.postgresql15Packages.timescaledb
pkgs.postgresql15Packages.timescaledb_toolkit
Expand All @@ -16,6 +17,7 @@
pkgs.icu
pkgs.gcc
pkgs.gnumake
pkgs.cmake
pkgs.go
pkgs.python311
pkgs.python311Packages.pip
Expand Down Expand Up @@ -44,7 +46,9 @@
services.docker.enable = true;

# Sets environment variables in the workspace
env = { };
env = {
DOTNET_ROOT = "/nix/store/3frycb58lshfmnkjv1rvqqz1s7wyvvck-dotnet-sdk-8.0.101";
};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
Expand Down Expand Up @@ -74,8 +78,9 @@
# Runs when a workspace is first created
onCreate = {
init-mongodb = "
mkdir -p ~/mongodb/var/lib/mongo/ &&
mkdir -p ~/mongodb/var/log/mongodb/ &&
rm -rf ~/.emu/avd
mkdir -p /mnt/ephemeral/mongodb/var/lib/mongo/ &&
mkdir -p /mnt/ephemeral/mongodb/var/log/mongodb/ &&
mongod -f ~/json-scada/platform-nix-idx/mongod.conf &&
mongosh json_scada < ~/json-scada/mongo_seed/a_rs-init.js &&
mongosh json_scada < ~/json-scada/mongo_seed/b_create-db.js &&
Expand Down
7 changes: 4 additions & 3 deletions platform-nix-idx/mongod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ net:
bindIp: 127.0.0.1
port: 27017
storage:
dbPath: "/home/user/mongodb/var/lib/mongo"
dbPath: "/mnt/ephemeral/mongodb/var/lib/mongo"
systemLog:
destination: file
path: "/home/user/mongodb/var/log/mongodb/mongod.log"
logAppend: true
path: "/mnt/ephemeral/mongodb/var/log/mongodb/mongod.log"
# path: "/home/user/mongodb/var/log/mongodb/mongod.log"
# logAppend: true

replication:
replSetName: rs1
Expand Down
27 changes: 26 additions & 1 deletion platform-nix-idx/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,34 @@ command=/usr/bin/node /home/user/json-scada/src/cs_data_processor/cs_data_proces
autostart=true
numprocs=1 ; number of processes copies to start (def 1)
directory=/home/user/json-scada/src/cs_data_processor/ ; directory to cwd to before exec (def no cwd)
user=jsonscada ; setuid to this UNIX account to run the program
user=user ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/home/user/json-scada/log/cs_data_processor.log ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)

[program:server_realtime_auth]
command=/usr/bin/node /home/user/json-scada/src/server_realtime_auth/index.js
autostart=true
numprocs=1 ; number of processes copies to start (def 1)
directory=/home/user/json-scada/src/server_realtime_auth/ ; directory to cwd to before exec (def no cwd)
user=user ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/home/user/json-scada/log/server_realtime_auth.log ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)

[program:iec104client]
; args: instance# loglevel
command=/home/user/json-scada/bin/iec104client 1 1
autostart=true
numprocs=1 ; number of processes copies to start (def 1)
directory=/home/user/json-scada/bin/ ; directory to cwd to before exec (def no cwd)
user=user ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/home/user/json-scada/log/iec104client.log ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0)

0 comments on commit 19548c9

Please sign in to comment.