3

I want to install jetbrains-toolbox in NixOS. It's useful to track the beta and cannery channels. I've found it asked before here, but I didn't encounter that problem so I decided to ask it again. So by using NixOS guide, after downloading and unpacking using this, I ran this

$ patchelf \
  --set-interpreter /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib/ld-linux-x86-64.so.2 \
  --set-rpath /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib:/nix/store/9sfmwj09ij65qnc8dgv8h56gf12b60nn-zlib-1.2.11/lib:/nix/store/dadpj611mynymmljn7s8d97kfsy89dmc-fuse-2.9.9/lib \
  jetbrains-toolbox                                                                                                                                             

$ ./jetbrains-toolbox
/run/user/1000/.mount_jetbraWshcwf/AppRun: line 14: ./glibcversion: No such file or directory
/run/user/1000/.mount_jetbraWshcwf/AppRun: line 14: [: : integer expression expected
/run/user/1000/.mount_jetbraWshcwf/AppRun: line 35: /run/user/1000/.mount_jetbraWshcwf/jetbrains-toolbox: No such file or directory
 

I searched a lot to find out how can I install glibcversion with no success! Any idea how can I fix this?

Also creating one is so easy! Create a file named glibcversion.c

#include <stdio.h>
#include <stdlib.h>
#include <gnu/libc-version.h>

int main(int argc, char *argv[]) {
  printf("glibc version: %s\n", gnu_get_libc_version());
}

build it

gcc glibcversion.c -o glibcversion

but how can I feed it to jetbrains-toolbox?

hadilq
  • 1,023
  • 11
  • 25

2 Answers2

3

I was able to build jetbrains-toolbox using appimageTools.wrapType2. I believe this creates a somewhat traditional environment where everything is correctly located in /usr/bin and so on. This also ensures that installed ides work correctly.

Also note, that the newest version 1.18.7455 doesn't work. But it works with 1.16.6319.

Here is a nix expression. Build it with nix-build -A jetbrains-toolbox <filename>.nix

with import <nixpkgs> {};
let
  name = "jetbrains-toolbox";
  version = "1.16.6319";
    #version = "1.18.7455";
  sha256 = "4e6f333839af8330a09d9d6fdcd6a635c9ca1f0ae239d8f268249dbd095ca880";
in rec {
  jetbrains-toolbox-src = stdenv.mkDerivation {
    name = "jetbrains-toolbox-src";

    src = fetchurl {
        url = "https://download.jetbrains.com/toolbox/${name}-${version}.tar.gz";
        inherit sha256;
    };

    installPhase = ''
        #mkdir -p $out/bin
        cp jetbrains-toolbox $out
    '';
  };

  jetbrains-toolbox = appimageTools.wrapType2 {
    inherit name;

    src = jetbrains-toolbox-src;

    extraPkgs = pkgs: with pkgs; [
      libcef
    ];

    meta = with stdenv.lib; {
      description = "A toolbox to manage JetBrains products";
      longDescription = ''
      The JetBrains Toolbox lets you install and manage JetBrains Products in muiltiple versions.
      '';
      homepage = "https://www.jetbrains.com/toolbox/";
      platforms = platforms.all;
    };
  };
}

Here a little gist how to use in a configuration.nix. Might not be the most idiomatic version... but I'm also new to Nixos :)

Databyte
  • 1,420
  • 1
  • 15
  • 24
1

Finally, it's possible to run a current version of Toolbox and I just made a PR to nixpgs, so you can see how it works for me here https://github.com/NixOS/nixpkgs/pull/174272

Anatoly
  • 1,551
  • 4
  • 21
  • 40