That makes sense and I think I’m getting closer. When changed home.packages to use micronaut-1_3_3 I am now getting an error from the overlay.
# nixos-rebuild switch
building Nix...
building the system configuration...
error: attribute 'micronaut-1_3_3' missing, at /nix/store/n4cy1al11ncn3hn4fp2maw5zhldsvvvi-source/overlays/use-adoptopenjdk11/default.nix:2:23
(use '--show-trace' to show detailed location information)
How do I get the overlay to recognize the package?
# nixos-rebuild switch
building Nix...
building the system configuration...
error: anonymous function at /nix/store/g85jk50f1qwk97rs6pwdf3k65ks3ridj-nur/nur/default.nix:1:1 called with unexpected argument 'overlays', at /etc/nixos/user.nix:15:11
(use '--show-trace' to show detailed location information)
What I was originally trying to do is use the nixpkgs.overlays option for home manager with the overlay.
I just wanted to follow up that I found the solution.
My problem was that I thought overlays could be applied to the nur repo. This is definitely not the case. Instead, the packages need to be added to nixpkgs first. The nur namespace cannot be used. This can be done using the overlay provided by the nur template.
I added this overlay to the nur overlays with an import so they are in a consistent location.
Now both overlays can be applied to update packages to use adoptopenjdk11.
I think it would be nice to add overlays to the nur repo. Then overlays could be applied and the nur namespace can be used. The overlays can be isolated to just that repo. The idea of use-adoptopenjdk11 is to only change the jdk for the packages in the nur repo.
If use-adoptopenjdk11 can be written to detect all packages with jdk and override it automatically that would be much nicer.
you can add a global nixpkgs overlay to replace the default jdk
anyway, there is a common way that replacing env JAVA _HOME and make effect on java base command line tools,