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

17
flake.lock generated
View file

@ -153,15 +153,16 @@
]
},
"locked": {
"lastModified": 1677856503,
"narHash": "sha256-TW8my47VpavO/PXA5hIumUcX80cj0AufojjUTdUonLw=",
"owner": "numtide",
"lastModified": 1678737005,
"narHash": "sha256-vZi9ToKb+0yETEGKzvHHs8n35iBI2lX1idJMCNHL3Z4=",
"owner": "chvp",
"repo": "devshell",
"rev": "643d1857fea4e71e7f251cb574f59b1d63778085",
"rev": "774ed1133ae1890524d629ae5af166313b66d0bc",
"type": "github"
},
"original": {
"owner": "numtide",
"owner": "chvp",
"ref": "background-services",
"repo": "devshell",
"type": "github"
}
@ -322,11 +323,11 @@
},
"nur": {
"locked": {
"lastModified": 1678730199,
"narHash": "sha256-yMiW6y2JZYrE180JFUWP77WebcsRS8DZbvfvN0n/mP4=",
"lastModified": 1678736733,
"narHash": "sha256-XMqRLhFTgtn/QLRXWE1J/ESGJJbnxSlqEL3ThvSHDX8=",
"owner": "nix-community",
"repo": "NUR",
"rev": "20de8d02be738e389a1daf6c324d60d947e053ad",
"rev": "cfef6b0e312480d27fd2624a34e71dd6d3cff116",
"type": "github"
},
"original": {

View file

@ -33,7 +33,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
url = "github:chvp/devshell/background-services";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";

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 ];