Jump to content

Jetbrains Tools: Difference between revisions

From NixOS Wiki
imported>Werner291
Fixed wrong link subheading
Max (talk | contribs)
Remove the awful paragraph about the hack with nix-ld
 
(8 intermediate revisions by 6 users not shown)
Line 4: Line 4:


Some Jetbrains IDE plugins such as Github Copilot need to be patched in order to work on NixOS.
Some Jetbrains IDE plugins such as Github Copilot need to be patched in order to work on NixOS.
At the time of writing, plugin support is not available in the latest stable version of Nixpkgs (23.05). To install a package from nixos-unstable, see the [https://nixos.wiki/index.php?title=FAQ&oldid=3528#How_can_I_install_a_package_from_unstable_while_remaining_on_the_stable_channel.3F FAQ].


For example, a package of CLion with the Github Copilot plugin pre-installed can be obtained by adding the following line to your package list:
For example, a package of CLion with the Github Copilot plugin pre-installed can be obtained by adding the following line to your package list:
Line 14: Line 12:


Note that Jetbrains IDEs tend to manage their configuration and plugins statefully. For example, if you have previously attempted to install Copilot through the IDE's plugin manager, you may need to delete the IDE's state in as described in the [https://www.jetbrains.com/help/clion/uninstall.html#linux JetBrains documentation].
Note that Jetbrains IDEs tend to manage their configuration and plugins statefully. For example, if you have previously attempted to install Copilot through the IDE's plugin manager, you may need to delete the IDE's state in as described in the [https://www.jetbrains.com/help/clion/uninstall.html#linux JetBrains documentation].
==== All Marketplace plugins via nix-jetbrains-plugins ====
The third-party repository [https://github.com/theCapypara/nix-jetbrains-plugins theCapypara/nix-jetbrains-plugins] provides a way to install any plugin from Jetbrains Marketplace. It is updated weekly.
Please note that these plugins are unpatched and may not work, in that case the plugin may be installable in a patched version directly via nixpkgs, see above.
== JetBrains Toolbox ==
{{Warning|IDEs downloaded through JetBrains Toolbox must also be launched through it. Using the IDEs directly through nixpkgs is a better option. See [https://github.com/NixOS/nixpkgs/issues/240444 nixpkgs#240444].}}
If you want to eschew a fully-stateless JetBrains IDE setup, JetBrains Toolbox manages everything under {{ic|~/.local/share/JetBrains/Toolbox}} but currently (Jan. 2024) needs some tweaks to get working.
<ol>
<li>Install {{ic|pkgs.jetbrains-toolbox}} and launch it once</li>
<li>Edit {{ic|~/.local/share/JetBrains/Toolbox/.storage.json}} to add the line {{ic|"preferredKeychain": "linux-fallback"}}</li>
<li>Start to log-in normally, but stop after the JetBrains webpage opens</li>
<li>Reopen JetBrains Toolbox, navigate to Settings, and click "Troubleshoot..."</li>
<li>Follow the manual login flow as directed</li>
</ol>
After following these steps, JetBrains Toolbox will store user credentials in an encrypted (with a static key) file at {{ic|~/.local/share/JetBrains/Toolbox/.securestorage}}. If not followed, JetBrains Toolbox is unable to retrieve credentials via {{ic|libsecret}} (due to bwrap sandboxing?) and persistently notifies the user to re-authorize.
[[Category:Applications]]

Latest revision as of 21:17, 6 January 2025

Various JetBrains IDEs and tools are available from nixpkgs under the `jetbrains` namespace. For instance, CLion is available as the jetbrains.clion package.

Plugins

Some Jetbrains IDE plugins such as Github Copilot need to be patched in order to work on NixOS.

For example, a package of CLion with the Github Copilot plugin pre-installed can be obtained by adding the following line to your package list:

     (pkgs.jetbrains.plugins.addPlugins pkgs.jetbrains.clion ["github-copilot"])

where pkgs is a suitable version of nixpkgs.

Note that Jetbrains IDEs tend to manage their configuration and plugins statefully. For example, if you have previously attempted to install Copilot through the IDE's plugin manager, you may need to delete the IDE's state in as described in the JetBrains documentation.

All Marketplace plugins via nix-jetbrains-plugins

The third-party repository theCapypara/nix-jetbrains-plugins provides a way to install any plugin from Jetbrains Marketplace. It is updated weekly.

Please note that these plugins are unpatched and may not work, in that case the plugin may be installable in a patched version directly via nixpkgs, see above.

JetBrains Toolbox

Warning: IDEs downloaded through JetBrains Toolbox must also be launched through it. Using the IDEs directly through nixpkgs is a better option. See nixpkgs#240444.

If you want to eschew a fully-stateless JetBrains IDE setup, JetBrains Toolbox manages everything under ~/.local/share/JetBrains/Toolbox but currently (Jan. 2024) needs some tweaks to get working.

  1. Install pkgs.jetbrains-toolbox and launch it once
  2. Edit ~/.local/share/JetBrains/Toolbox/.storage.json to add the line "preferredKeychain": "linux-fallback"
  3. Start to log-in normally, but stop after the JetBrains webpage opens
  4. Reopen JetBrains Toolbox, navigate to Settings, and click "Troubleshoot..."
  5. Follow the manual login flow as directed

After following these steps, JetBrains Toolbox will store user credentials in an encrypted (with a static key) file at ~/.local/share/JetBrains/Toolbox/.securestorage. If not followed, JetBrains Toolbox is unable to retrieve credentials via libsecret (due to bwrap sandboxing?) and persistently notifies the user to re-authorize.