From 2e49db495af0dd6ece25b45bc620cec38ba1532e Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Tue, 14 Mar 2023 14:00:31 +0100 Subject: [PATCH] Use added ruby support in devshell --- flake.lock | 4 ++-- shells/dodona.nix | 15 ++++----------- shells/gamification2.nix | 15 ++++----------- shells/tab.nix | 17 ++++------------- shells/tap.nix | 18 ++++-------------- 5 files changed, 18 insertions(+), 51 deletions(-) diff --git a/flake.lock b/flake.lock index 70679b1a..da25ccce 100644 --- a/flake.lock +++ b/flake.lock @@ -153,11 +153,11 @@ ] }, "locked": { - "lastModified": 1678792404, + "lastModified": 1678798690, "narHash": "sha256-ES6PnlxlQ8ROzHhMKUzuvwmTZvoift1LXyG+LN7TBNI=", "owner": "chvp", "repo": "devshell", - "rev": "a3869357ec18d35dc10083dd0fef42fddf4f7f17", + "rev": "5f31e3757888be373af78b724982bb4018406c98", "type": "github" }, "original": { diff --git a/shells/dodona.nix b/shells/dodona.nix index e12b03ff..b4e4ef8b 100644 --- a/shells/dodona.nix +++ b/shells/dodona.nix @@ -16,24 +16,18 @@ let in pkgs.devshell.mkShell { name = "Dodona"; - imports = [ "${inputs.devshell}/extra/language/c.nix" ]; + imports = [ "${inputs.devshell}/extra/language/ruby.nix" ]; packages = with pkgs; [ - (pkgs.lowPrio binutils) chromedriver ungoogled-chromium - findutils - gnumake nodejs nodePackages.typescript-language-server - ruby_3_1 rubyPackages_3_1.solargraph yarn ]; env = [ { 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 = [ { @@ -65,9 +59,8 @@ pkgs.devshell.mkShell { server.services = all-services; server-support.services = support-services; }; - language.c = { - compiler = pkgs.gcc; - includes = [ pkgs.libmysqlclient pkgs.zlib pkgs.libffi ]; - libraries = [ pkgs.libmysqlclient pkgs.zlib pkgs.libffi ]; + language.ruby = { + package = pkgs.ruby_3_1; + nativeDeps = [ pkgs.libmysqlclient pkgs.zlib pkgs.libffi ]; }; } diff --git a/shells/gamification2.nix b/shells/gamification2.nix index 06bfa0c5..9121ae19 100644 --- a/shells/gamification2.nix +++ b/shells/gamification2.nix @@ -1,10 +1,8 @@ { pkgs, inputs }: pkgs.devshell.mkShell { name = "Gamification 2"; - imports = [ "${inputs.devshell}/extra/language/c.nix" ]; + imports = [ "${inputs.devshell}/extra/language/ruby.nix" ]; env = [ { 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 = [ @@ -48,22 +46,17 @@ } ]; 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 ]; - libraries = [ pkgs.zlib pkgs.openssl ]; + language.ruby = { + package = pkgs.ruby_3_1; + nativeDeps = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; }; } diff --git a/shells/tab.nix b/shells/tab.nix index f42ea60e..04782fc4 100644 --- a/shells/tab.nix +++ b/shells/tab.nix @@ -1,6 +1,6 @@ { pkgs, inputs }: pkgs.devshell.mkShell { name = "Tab"; - imports = [ "${inputs.devshell}/extra/language/c.nix" ]; + imports = [ "${inputs.devshell}/extra/language/ruby.nix" ]; commands = [ { name = "refresh-deps"; @@ -13,26 +13,17 @@ ''; } ]; - 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 - gnumake - ruby_3_1 nodejs yarn ]; - language.c = { - compiler = pkgs.gcc; - includes = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; - libraries = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; + language.ruby = { + package = pkgs.ruby_3_1; + nativeDeps = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; }; } diff --git a/shells/tap.nix b/shells/tap.nix index b1852c1c..9a8b17cb 100644 --- a/shells/tap.nix +++ b/shells/tap.nix @@ -1,6 +1,6 @@ { pkgs, inputs }: pkgs.devshell.mkShell { name = "Tap"; - imports = [ "${inputs.devshell}/extra/language/c.nix" ]; + imports = [ "${inputs.devshell}/extra/language/ruby.nix" ]; commands = [ { name = "refresh-deps"; @@ -13,17 +13,8 @@ ''; } ]; - 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 - file - findutils - gnumake - ruby_3_0 nodejs yarn ]; @@ -31,9 +22,8 @@ name = "server"; command = "rails s -p 3000"; }; - language.c = { - compiler = pkgs.gcc; - includes = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; - libraries = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; + language.ruby = { + package = pkgs.ruby_3_0; + nativeDeps = [ pkgs.sqlite pkgs.libmysqlclient pkgs.zlib ]; }; }