Last active
August 29, 2022 23:31
-
-
Save SrTobi/ee6104514e2f14a0f1eae201654f2012 to your computer and use it in GitHub Desktop.
Example of a custom package for your configuration.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, stdenv, fetchurl, ... }: | |
let | |
name = "jetbrains-toolbox"; | |
version = "1.16.6319"; | |
#version = "1.18.7455"; | |
sha256 = "4e6f333839af8330a09d9d6fdcd6a635c9ca1f0ae239d8f268249dbd095ca880"; | |
jetbrains-toolbox-src = stdenv.mkDerivation { | |
name = "${name}-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-f = extraPkgs: pkgs.appimageTools.wrapType2 { | |
inherit name; | |
src = jetbrains-toolbox-src; | |
extraPkgs = pkgs: with pkgs; [ | |
libcef | |
] ++ extraPkgs; | |
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; | |
}; | |
}; | |
makeWithExtraPackages = f: origArgs: | |
let origRes = f origArgs; | |
in origRes // { withExtraPkgs = newArgs: (f newArgs); }; | |
in makeWithExtraPackages jetbrains-toolbox-f [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Reference: https://github.com/nagygergo/jetbrains-toolbox-install/blob/master/jetbrains-toolbox.sh | |
TOOLBOX_URL=$(curl --silent 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' \ | |
-H 'Origin: https://www.jetbrains.com' \ | |
-H 'Accept-Encoding: gzip, deflate, br' \ | |
-H 'Accept-Language: en-US,en;q=0.8' \ | |
-H 'Accept: application/json, text/javascript, */*; q=0.01' \ | |
-H 'Referer: https://www.jetbrains.com/toolbox/download/' \ | |
-H 'Connection: keep-alive' \ | |
-H 'DNT: 1' \ | |
--compressed \ | |
| grep -Po '"linux":.*?[^\\]",' \ | |
| awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g') | |
echo ${TOOLBOX_URL} | |
curl -sL ${TOOLBOX_URL}.sha256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a module. | |
# Import it from your configuration.nix | |
{ pkgs, config, ... }: | |
{ | |
environment.systemPackages = with pkgs; [ | |
# make toolbox depend on fontPackages to use all installed fonts | |
(jetbrains-toolbox.withExtraPkgs config.fonts.fontconfig.confPackages) | |
]; | |
nixpkgs.config.packageOverrides = pkgs: { | |
jetbrains-toolbox = pkgs.callPackage ./jetbrains-toolbox {}; | |
}; | |
} |
I guess such things are massively slowing down the adoption of Nixos.
Yeah, nixos is a great idea, I really mean that. But the problem is that all the software is developed for a system that works different... and NixOS has to work with that... Still I will continue using it...
I've spent some time with this problem and got some additional piece of the puzzle
$ APPIMAGE_DEBUG_EXEC=bash ./result/bin/jetbrains-toolbox -d
this helped me to jump into the AppImage and manually running ./jetbrains-toolbox returned
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
this looks like some missing java libraries
but it might be an outcome of me not knowing what I'm doing
How about running it in a steam env ? I think it would work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was about to comment that ! Indeed, I can install the package but I'm unable to run it.
This is so sad.
I guess such things are massively slowing down the adoption of Nixos.