Use personal devshell fork

This commit is contained in:
Charlotte Van Petegem 2023-03-13 20:57:27 +01:00
parent 40f2eb127c
commit 725fe830f8
No known key found for this signature in database
GPG key ID: 019E764B7184435A
3 changed files with 27 additions and 42 deletions

View file

@ -1,18 +1,18 @@
{ pkgs, inputs }:
let
support-procfile-text = ''
memcached: memcached
mysql: mysql
worker: rails jobs:work
css: yarn build:css --watch
js: yarn build:js --watch
'';
support-procfile = pkgs.writeText "Procfile.supp" support-procfile-text;
all-procfile-text = support-procfile-text + ''
server: rails s -p 3000
'';
all-procfile = pkgs.writeText "Procfile.all" all-procfile-text;
support-services = {
memcached.command = "memcached";
mysql.command = "mysql";
worker.command = "rails jobs:work";
css.command = "yarn build:css --watch";
js.command = "yarn build:js --watch";
};
all-services = support-services // {
rails = {
name = "server";
command = "rails s -p 3000";
};
};
in
pkgs.devshell.mkShell {
name = "Dodona";
@ -53,27 +53,11 @@ pkgs.devshell.mkShell {
docker run --name dodona-db -p 3306:3306 --rm -v dodona-db-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=dodona mariadb:latest
'';
}
{
name = "server-support";
category = "general commands";
help = "Run everything required for a server";
command = ''
bundle install
yarn install
${pkgs.honcho}/bin/honcho start -f ${support-procfile} -d $PRJ_ROOT
'';
}
{
name = "server";
category = "general commands";
help = "Run everything";
command = ''
bundle install
yarn install
${pkgs.honcho}/bin/honcho start -f ${all-procfile} -d $PRJ_ROOT
'';
}
];
serviceGroups = {
server.services = all-services;
server-support.services = support-services;
};
language.c = {
compiler = pkgs.gcc;
includes = [ pkgs.libmysqlclient pkgs.zlib pkgs.libffi ];