Update shells a bit

This commit is contained in:
Charlotte Van Petegem 2023-03-14 11:39:45 +01:00
parent 1414da9c00
commit 57f21d8d0d
No known key found for this signature in database
GPG key ID: 019E764B7184435A
8 changed files with 98 additions and 85 deletions

View file

@ -30,15 +30,22 @@ pkgs.devshell.mkShell {
yarn
];
env = [
{ name = "CC"; value = "cc"; }
{ name = "CPP"; value = "cpp"; }
{ name = "CXX"; value = "c++"; }
{ name = "DATABASE_URL"; value = "mysql2://root:dodona@127.0.0.1:3306/dodona"; }
{ name = "TEST_DATABASE_URL"; value = "mysql2://root:dodona@127.0.0.1:3306/dodona_test"; }
{ name = "GEM_HOME"; eval = "$PRJ_DATA_DIR/bundle/$(ruby -e 'puts RUBY_VERSION')"; }
{ name = "PATH"; prefix = "$GEM_HOME/bin"; }
];
commands = [
{
name = "refresh-deps";
category = "general commands";
help = "Install dependencies";
command = ''
yarn install
bundle install
bundle pristine
'';
}
{
name = "memcached";
category = "general commands";

View file

@ -1,24 +1,23 @@
{ pkgs, inputs }: pkgs.devshell.mkShell {
name = "Gamification 2";
imports = [ "${inputs.devshell}/extra/language/c.nix" ];
packages = with pkgs; [
(pkgs.lowPrio binutils)
findutils
cmake
gnumake
nodejs
postgresql_14
ruby_3_1
yarn
];
env = [
{ name = "NIX_CC"; value = "${pkgs.gcc}"; }
{ name = "PGDATA"; eval = "$PRJ_DATA_DIR/postgres"; }
{ name = "DATABASE_HOST"; eval = "$PGDATA"; }
{ name = "GEM_HOME"; eval = "$PRJ_DATA_DIR/bundle/$(ruby -e 'puts RUBY_VERSION')"; }
{ name = "PATH"; prefix = "$GEM_HOME/bin"; }
{ name = "PGDATA"; eval = "$PRJ_DATA_DIR/postgres"; }
];
commands = [
{
name = "refresh-deps";
category = "general commands";
help = "Install dependencies";
command = ''
yarn install
bundle install
bundle pristine
'';
}
{
name = "pg:setup";
category = "database";
@ -36,15 +35,7 @@
help = "Start postgres instance";
command = ''
[ ! -d $PGDATA ] && pg:setup
pg_ctl -D $PGDATA -U postgres start -l log/postgres.log
'';
}
{
name = "pg:stop";
category = "database";
help = "Stop postgres instance";
command = ''
pg_ctl -D $PGDATA -U postgres stop
postgres
'';
}
{
@ -52,10 +43,24 @@
category = "database";
help = "Open database console";
command = ''
psql --host $PGDATA -U postgres
psql --host $PGDATA s
'';
}
];
packages = with pkgs; [
(pkgs.lowPrio binutils)
findutils
cmake
gnumake
nodejs
postgresql_14
ruby_3_1
yarn
];
serviceGroups.server.services = {
web.command = "rails s -p 3000";
postgres.command = "pg:start";
};
language.c = {
compiler = pkgs.gcc;
includes = [ pkgs.zlib pkgs.openssl ];

View file

@ -1,10 +1,23 @@
{ pkgs, inputs }: pkgs.devshell.mkShell {
name = "NixOS config";
commands = [
{
name = "format-all";
category = "general commands";
help = "Format all nix files in the project";
command = "find $PRJ_ROOT -type f -name '*.nix' -print0 | xargs -0 nixpkgs-fmt";
}
{
name = "fetchpatch";
category = "general commands";
help = "Fetch a patch from a nixpkgs PR by its ID";
command = "curl -L https://github.com/NixOS/nixpkgs/pull/$1.patch -o $PRJ_ROOT/patches/$1.patch";
}
];
packages = [
pkgs.agenix
# Use nixos-rebuild from flake, since it might be patched
pkgs.nixos-rebuild
pkgs.nixpkgs-fmt
(pkgs.writeShellScriptBin "fetchpatch" "curl -L https://github.com/NixOS/nixpkgs/pull/$1.patch -o patches/$1.patch")
inputs.agenix.packages.${pkgs.system}.default
];
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }: pkgs.devshell.mkShell {
name = "Scriptingtalen project";
packages = with pkgs; [ (python3.withPackages (ps: with ps; [ beautifulsoup4 requests ])) ];
}

View file

@ -1,6 +1,27 @@
{ pkgs, inputs }: pkgs.devshell.mkShell {
name = "Tab";
imports = [ "${inputs.devshell}/extra/language/c.nix" ];
commands = [
{
name = "refresh-deps";
category = "general commands";
help = "Install dependencies";
command = ''
yarn install
bundle install
bundle pristine
'';
}
];
env = [
{ name = "GEM_HOME"; eval = "$PRJ_DATA_DIR/bundle/$(ruby -e 'puts RUBY_VERSION')"; }
{ name = "PATH"; prefix = "$GEM_HOME/bin"; }
];
serviceGroups.server.services = {
web.command = "rails s -p 3000";
js.command = "yarn build:dev --watch";
css.command = "yarn build:css --watch";
};
packages = with pkgs; [
(pkgs.lowPrio binutils)
findutils
@ -9,29 +30,6 @@
nodejs
yarn
];
env = [
{ name = "GEM_HOME"; eval = "$PRJ_DATA_DIR/bundle/$(ruby -e 'puts RUBY_VERSION')"; }
{ name = "PATH"; prefix = "$GEM_HOME/bin"; }
];
commands = [
{
name = "server-support";
category = "general commands";
help = "Run everything required for a server";
command = ''
bundle install
'';
}
{
name = "server";
category = "general commands";
help = "Run everything";
command = ''
server-support
rails s
'';
}
];
language.c = {
compiler = pkgs.gcc;
includes = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ];

View file

@ -1,6 +1,22 @@
{ pkgs, inputs }: pkgs.devshell.mkShell {
name = "Tap";
imports = [ "${inputs.devshell}/extra/language/c.nix" ];
commands = [
{
name = "refresh-deps";
category = "general commands";
help = "Install dependencies";
command = ''
yarn install
bundle install
bundle pristine
'';
}
];
env = [
{ name = "GEM_HOME"; eval = "$PRJ_DATA_DIR/bundle/$(ruby -e 'puts RUBY_VERSION')"; }
{ name = "PATH"; prefix = "$GEM_HOME/bin"; }
];
packages = with pkgs; [
(pkgs.lowPrio binutils)
imagemagick
@ -11,32 +27,10 @@
nodejs
yarn
];
env = [
{ name = "CC"; value = "cc"; }
{ name = "CPP"; value = "cpp"; }
{ name = "CXX"; value = "c++"; }
{ name = "GEM_HOME"; eval = "$PRJ_DATA_DIR/bundle/$(ruby -e 'puts RUBY_VERSION')"; }
{ name = "PATH"; prefix = "$GEM_HOME/bin"; }
];
commands = [
{
name = "server-support";
category = "general commands";
help = "Run everything required for a server";
command = ''
bundle install
'';
}
{
name = "server";
category = "general commands";
help = "Run everything";
command = ''
server-support
rails s
'';
}
];
serviceGroups.server.services.rails = {
name = "server";
command = "rails s -p 3000";
};
language.c = {
compiler = pkgs.gcc;
includes = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ];