Add program to open a rails console in accentor
This commit is contained in:
parent
192eba674b
commit
31b1095eb1
1 changed files with 35 additions and 17 deletions
|
@ -53,6 +53,23 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.chvp.accentor.enable {
|
config = lib.mkIf config.chvp.accentor.enable {
|
||||||
|
environment.systemPackages = [
|
||||||
|
(pkgs.writeShellScriptBin "accentor-console" ''
|
||||||
|
set -ex
|
||||||
|
export DATABASE_URL="postgresql://%2Frun%2Fpostgresql/accentor"
|
||||||
|
export FFMPEG_LOG_LOCATION="/var/log/accentor/ffmpeg.log"
|
||||||
|
export RAILS_STORAGE_PATH="${config.chvp.dataPrefix}/var/lib/accentor/storage"
|
||||||
|
export RAILS_TRANSCODE_CACHE="/var/tmp/accentor/transcode_cache"
|
||||||
|
export BOOTSNAP_CACHE_DIR="/var/tmp/accentor/bootsnap"
|
||||||
|
export PIDFILE="/run/accentor/server.pid"
|
||||||
|
export RACK_ENV="production"
|
||||||
|
export RAILS_ENV="production"
|
||||||
|
export RAILS_LOG_TO_STDOUT="yes"
|
||||||
|
cd ${api}
|
||||||
|
${gems}/bin/bundle exec rails c
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "${config.chvp.dataPrefix}/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}";
|
dataDir = "${config.chvp.dataPrefix}/var/lib/postgresql/${config.services.postgresql.package.psqlSchema}";
|
||||||
|
@ -89,7 +106,8 @@ in
|
||||||
ExecStart = "${gems}/bin/bundle exec puma -C ${api}/config/puma.rb";
|
ExecStart = "${gems}/bin/bundle exec puma -C ${api}/config/puma.rb";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} // (builtins.foldl' (x: y: x // y) {} (builtins.genList (n: {
|
} // (builtins.foldl' (x: y: x // y) { } (builtins.genList
|
||||||
|
(n: {
|
||||||
"accentor-worker${toString n}" = {
|
"accentor-worker${toString n}" = {
|
||||||
after = [ "network.target" "accentor-api.service" "postgresql.service" ];
|
after = [ "network.target" "accentor-api.service" "postgresql.service" ];
|
||||||
requires = [ "accentor-api.service" "postgresql.service" ];
|
requires = [ "accentor-api.service" "postgresql.service" ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue