cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.61k stars 262 forks source link

Gleam does not work out of the box. #1086

Closed abeljim closed 1 month ago

abeljim commented 2 months ago

Describe the bug Gleam test is not working out of the box,

To reproduce Used devenv init to create a environment. languages.gleam.enable = true; Use 'gleam init test_ project' to create a project. Cd in and use the 'gleam test' command for the result below. Adding the erlang package resolves this.

❯ gleam test Resolving versions Downloading packages Downloaded 2 packages in 0.01s Compiling gleam_stdlib error: Program not found

The program escript was not found. Is it installed? Documentation for installing Erlang can be viewed here: https://gleam.run/getting-started/installing/

Version devenv 1.0.1 (x86_64-linux)

Running on Nixos.

domenkozar commented 2 months ago

cc @vic

domenkozar commented 2 months ago

Could you contribute a test to examples/gleam?

abeljim commented 2 months ago

1087 Created Pull Request

hqm42 commented 2 months ago

To make it work right now, you need to add erlang and rebar3 to your devenv.nix: https://gleam.run/getting-started/installing/

{ pkgs, ... }:

{
  packages = [ pkgs.rebar3 ];
  languages.erlang.enable = true;
  languages.gleam.enable = true;
}
domenkozar commented 2 months ago

Should rebar3 be part of erlang and gleam should also enable erlang?

hqm42 commented 2 months ago

Sounds good to me. Could be configured via something like languages.erlang.rebar3.enable with true as default. Erlang package could be overridden via the existing languages.erlang.package