Adding a new nixpkg with different scala version


Currently I see a scala 2.12 version of scalafix in nixpkgs. I’d like to use scala 2.11 version of scalafix. currently all of the scala packages uses 2.12 version by default, it would be nice to also see 2.11 version of scala packages in nix channel.

I am new to nix and nixpkgs. What is the acceptable way to add this new pkg with different scala version? one way could be just creating a new pkg with same name, plus scala version as suffix, but doesn’t sound like a good idea.


scalafix package does not depend on scala package (moreover it uses scala 2.12.7 which is slightly outdated, while default scala is 2.12.8):

The easier way to get scalafix with scala-2.11 would be by copying the file and change the version in it (would it depend on scala as most of the packages depend on the language package, then it would be as easy as scalafix.override{ scala = scala_2_11; }, but not in this case)

1 Like

I don’t use this package, but it might be a good idea to make the dependency overridable, so you don’t have to copy the file to change it.

1 Like

thanks. I will try that out and will make a PR

1 Like