I’m trying to override the jetbrains idea-ultimate-2019-2.4 derivation as it depends upon a non-existing derivation jbrsdk-11_0_2-osx-x64-b485.1.tar.gz.drv.
I had assumed that overriding an attribute would do just that and not download the broken package.
How do I discover where it is still being depended and override it? Can I list the computed overridable attributes somehow?
However, even thought I’ve overridden the jdk attribute, it still seems to want to include the broken derivation in the list of derivations to be build.
nix-channel --update; nix-env -iA nixpkgs.myPackages
unpacking channels...
replacing old 'my-packages'
installing 'my-packages'
these derivations will be built:
/nix/store/9kfi3k9q6hi7z3lwann318hndbah535v-idea-ultimate.desktop.drv
/nix/store/ica1m5yq3f3y05xnw7ln1lnfvp0yjvyf-download_file?file_path=jbrsdk-11_0_4-osx-x64-b520.11.tar.gz.drv
/nix/store/bf2hwhrvfl8g77gdiw053rayh06x0120-jetbrainsjdk-520.11.drv
/nix/store/fazsa1a4l70s391rjk9yyi2hvrg0zbmp-download_file?file_path=jbrsdk-11_0_2-osx-x64-b485.1.tar.gz.drv
/nix/store/fwwk976sd278zb68zy9wm5pkxss0rnhg-jetbrainsjdk-485.1.drv
/nix/store/s3m2bpcyrnx9dcq4drh95882n0mk1d6m-ideaIU-2019.2.4-no-jbr.tar.gz.drv
/nix/store/9kiajpmmsp3i6ysj4vdqq8dzi84mnr73-idea-ultimate-2019.2.4.drv
/nix/store/jh1ixm54qinv8pk6kypvv6n6cfr4sws8-my-packages.drv
these paths will be fetched (0.02 MiB download, 0.12 MiB unpacked):
/nix/store/hp90sbwznq1msv327f0lb27imvcvi80h-libnotify-0.7.8
building '/nix/store/9kfi3k9q6hi7z3lwann318hndbah535v-idea-ultimate.desktop.drv'...
copying path '/nix/store/hp90sbwznq1msv327f0lb27imvcvi80h-libnotify-0.7.8' from 'https://cache.nixos.org'...
building '/nix/store/fazsa1a4l70s391rjk9yyi2hvrg0zbmp-download_file?file_path=jbrsdk-11_0_2-osx-x64-b485.1.tar.gz.drv'...
trying https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrsdk-11_0_2-osx-x64-b485.1.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
error: cannot download download_file?file_path=jbrsdk-11_0_2-osx-x64-b485.1.tar.gz from any mirror
builder for '/nix/store/fazsa1a4l70s391rjk9yyi2hvrg0zbmp-download_file?file_path=jbrsdk-11_0_2-osx-x64-b485.1.tar.gz.drv' failed with exit code 1
building '/nix/store/ica1m5yq3f3y05xnw7ln1lnfvp0yjvyf-download_file?file_path=jbrsdk-11_0_4-osx-x64-b520.11.tar.gz.drv'...
cannot build derivation '/nix/store/fwwk976sd278zb68zy9wm5pkxss0rnhg-jetbrainsjdk-485.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/9kiajpmmsp3i6ysj4vdqq8dzi84mnr73-idea-ultimate-2019.2.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/jh1ixm54qinv8pk6kypvv6n6cfr4sws8-my-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/jh1ixm54qinv8pk6kypvv6n6cfr4sws8-my-packages.drv' failed
I’ve just tried your snippet and it doesn’t download two version of JDK:
$ nix-env -iA nixpkgs.myIdeaUltimate --dry-run
installing 'idea-ultimate-2019.1.1'
these derivations will be built:
/nix/store/11ghwdcpfzbqxccxfyw7fjh700d7rzf7-download_file?file_path=jbrsdk-11_0_4-osx-x64-b520.11.tar.gz.drv
/nix/store/27aqwz57xnrjsba8zsh111lm37v2mm2l-ideaIU-2019.1.1-no-jbr.tar.gz.drv
/nix/store/69xm1bfgqh4c2pcf2w3mj26ngbcblj99-jetbrainsjdk-164.drv
/nix/store/fscjb3f7pg566v3xdn759s9pnkr0mszs-idea-ultimate-2019.1.1.drv
these paths will be fetched (169.02 MiB download, 402.18 MiB unpacked):
/nix/store/659si0x9cf4fywfy0c6ihw05rx57r9qn-jetbrainsjdk-164
/nix/store/ihppkwjq3zvgsc2fgkajgx0dp3v4v6ll-p7zip-16.02
/nix/store/j4gw53x4cn8dqycmgkxc3g1vxkibj70g-libav-0.8.21
nix-env -i 'idea-ultimate' --dry-run
(dry run; not doing anything)
error: attempt to call something which is not a function but a set, at /Users/ldeck/.config/nixpkgs/overlays/02-jetbrains.nix:2:15
btw, I’ve reproduced the error. I was wrong, it indeed downloads old jdk version as well (but on linux it downloads it from binary cache). I’ll look into
This installs happily via nix-env -iA 'nixpkgs.jetbrains.idea-ultimate’.
But when executing it complains it doesn’t know about the JDK_HOME.
ldeck@ldeck ~ % which idea-ultimate
/Users/ldeck/.nix-profile/bin/idea-ultimate
ldeck@ldeck ~ % idea-ultimate
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
ERROR: Cannot start IntelliJ IDEA
No JDK found. Please validate either IDEA_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.