I’m looking for a way to override the vmopts
that are passed to JetBrains derivations (e.g. Goland, Idea, Clion, etc.). It seems like this was the intention of making vmopts
configurable.
Here’s parameter (from pkgs/top-level/all-packages.nix
) I wish to configure:
jetbrains = (recurseIntoAttrs (callPackages ../applications/editors/jetbrains {
vmopts = config.jetbrains.vmopts or null;
jdk = jetbrains.jdk;
}) // {
jdk = callPackage ../development/compilers/jetbrains-jdk { };
});
I’ve tried setting config.jetbrains.vmopts
directly, and also an overlay:
self: super:
{
jetbrains = super.jetbrains // {
vmopts = ''
-Xms8g
-Xmx8g
'';
};
}
Neither seem to work. When I inspect ~/.config/JetBrains/GoLand2022.1/goland64.vmoptions
, I don’t see the override.
There’s a few different layers of indirection that are making this tricky:
-
default.nix
passes down to a platform specific package: https://github.com/NixOS/nixpkgs/blob/efb7405702e62f6edbdcfcacd2ce3e56aa9de40a/pkgs/applications/editors/jetbrains/default.nix#L23 - example of the Linux package: https://github.com/NixOS/nixpkgs/blob/efb7405702e62f6edbdcfcacd2ce3e56aa9de40a/pkgs/applications/editors/jetbrains/linux.nix#L32
I feel like an overlay is what I want, but I’m missing something about how to write it correctly.
I’m trying to make this portable enough to work on NixOS, but also with standalone home-manager setups, on both Linux and Darwin.