skip to Main Content

Every time I install Erlang, I end up without Observer. Used the commands below on a Ubuntu laptop with Xmonad and a Debian 9 running in the cloud, and seemingly they both resulted in the same package being installed:

  • nix-env -iA pkgs.beam.packages.erlangR22
  • nix-env -iA nixpkgs.beam.interpreters.erlang
  • nix-env -iA nixpkgs.beam.interpreters.erlangR22_odbc_javac

The Nixpkgs manuals 15.2. BEAM Languages (Erlang, Elixir & LFE) section (Version 19.09.1484.84586a4514d) does not mention Observer at all. It has a fairly recent update by DianaOlympos that does mention it, albeit I tried all these packages, but no joy:

Many Erlang/OTP distributions available in beam.interpreters have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there’s beam.interpreters.erlangR22_odbc_javac, which corresponds to beam.interpreters.erlangR22 and beam.interpreters.erlangR22_nox, which corresponds to beam.interpreters.erlangR22.

Shane Sveller pointed it out that the wxGTK package needs to be set up using propagatedBuildInputs, but not sure how to do that. (Simply just installing wxGTK then Erlang doesn’t work of course; was naive enough to try it. Also found out that chapter 20 of Nix Pills is exactly about this topic.)

This is also kind of a follow-up to the question “How to install Erlang/Elixir on a non-NixOS system?“, but I didn’t realize it then that Observer is missing…


update: Apparently, it works somewhere out of the box. (Probably on NixOS.)

2

Answers


  1. Chosen as BEST ANSWER

    Kind of ashamed to admit that I am an idiot, but Observer was there all this time (along with net_adm)...

    For some reason, it wouldn't autocomplete on the erl shell, but once observer:start(). was typed in and executed, it would recognize the module, and provide a list of available functions when hitting the Tab key.

    I probably messed up translating between iex and erl ( observer.start(). and other combinations), and I assumed that the resulting error message (together with no autocompletion) means that the module was missing.


  2. I have an overwrite for erlang, such that wx support is enabled:

    { pkgs ? import <nixpkgs> {} }:
    
    with pkgs;
    
    let
      inherit (lib) optionals;
    
      erlang_wx = erlangR21.override {
        wxSupport = true;
      };
    
      elixir = (beam.packagesWith erlang_wx).elixir.override {
        version = "1.9.2";
        rev = "ffe7a577cc80f37381dc289c820842d346002364";
        sha256 = "19yn6nx6r627f5zbyc7ckgr96d6b45sgwx95n2gp2imqwqvpj8wc";
      };
    in
    
    mkShell {
      buildInputs = [ elixir git ]
    
        # For file_system on Linux.
        ++ optionals stdenv.isLinux [ inotify-tools wxGTK ]
    
        # For file_system on macOS.
        ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
          # For file_system on macOS.
          CoreFoundation
          CoreServices
          wxmac
        ]);
    }
    

    Save this (as shell.nix for example), and just run it:

    $ nix-shell shell.nix
    
    # or, if you are in the same directory:
    $ nix-shell
    

    Works on my machine!


    Note: wxmac in buildInputs is specific to MacOS (and wxGTK to Linux). To find the right package for your OS, here are the available wx packages.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search