From b3565b34477b2e8dbea174cfc9020ac248644731 Mon Sep 17 00:00:00 2001 From: Norbert Melzer Date: Fri, 16 Dec 2022 07:10:26 +0100 Subject: [PATCH] java: remove IFD The previous variant used IFD to generate the `JAVA_HOME` variable and relied on internal hooks of the `java` package, this failed for a user cross compiling their configuration. This PR changes that and uses the `home` attribute, as documented in the very last sentence of the https://nixos.org/manual/nixpkgs/stable/#sec-language-java chapter. --- modules/programs/java.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/programs/java.nix b/modules/programs/java.nix index 5b2a01299..24467a255 100644 --- a/modules/programs/java.nix +++ b/modules/programs/java.nix @@ -36,11 +36,6 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - home.sessionVariables = { - JAVA_HOME = fileContents (pkgs.runCommandLocal "java-home" { } '' - source "${cfg.package}/nix-support/setup-hook" - echo "$JAVA_HOME" > $out - ''); - }; + home.sessionVariables.JAVA_HOME = cfg.package.home; }; }