From bf4563a83128156d2a8262f784f16029f0a5a7cd Mon Sep 17 00:00:00 2001 From: Rishi Kumar Date: Fri, 26 Jul 2024 19:57:20 +0530 Subject: [PATCH 1/3] feat: Add option to select jdk with clojure --- src/modules/languages/clojure.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/modules/languages/clojure.nix b/src/modules/languages/clojure.nix index 68634d221..0490649cd 100644 --- a/src/modules/languages/clojure.nix +++ b/src/modules/languages/clojure.nix @@ -6,12 +6,26 @@ in { options.languages.clojure = { enable = lib.mkEnableOption "tools for Clojure development"; + jdk.package = lib.mkOption { + type = lib.types.package; + example = lib.literalExpression "pkgs.jdk8"; + default = pkgs.jdk; + defaultText = lib.literalExpression "pkgs.jdk"; + description = '' + The JDK package to use. + This will also become available as `JAVA_HOME`. + ''; + }; }; config = lib.mkIf cfg.enable { packages = with pkgs; [ - clojure + (clojure.override { + jdk = cfg.jdk.package; + }) clojure-lsp ]; + + env.JAVA_HOME = cfg.jdk.package.home; }; } From 645ebca3c03784bb9794fbeee569bcc8bbaedfef Mon Sep 17 00:00:00 2001 From: Rishi Kumar Date: Sat, 27 Jul 2024 01:33:12 +0530 Subject: [PATCH 2/3] chore: Use java from config.languages.java --- src/modules/languages/clojure.nix | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/modules/languages/clojure.nix b/src/modules/languages/clojure.nix index 0490649cd..72375951c 100644 --- a/src/modules/languages/clojure.nix +++ b/src/modules/languages/clojure.nix @@ -6,26 +6,17 @@ in { options.languages.clojure = { enable = lib.mkEnableOption "tools for Clojure development"; - jdk.package = lib.mkOption { - type = lib.types.package; - example = lib.literalExpression "pkgs.jdk8"; - default = pkgs.jdk; - defaultText = lib.literalExpression "pkgs.jdk"; - description = '' - The JDK package to use. - This will also become available as `JAVA_HOME`. - ''; - }; }; config = lib.mkIf cfg.enable { packages = with pkgs; [ (clojure.override { - jdk = cfg.jdk.package; + jdk = config.languages.java.jdk.package; }) clojure-lsp ]; + languages.java.enable = true; - env.JAVA_HOME = cfg.jdk.package.home; + env.JAVA_HOME = config.languages.java.jdk.package.home; }; } From 262ce7e7b43baaae01a8c10bf170517aaf42a38b Mon Sep 17 00:00:00 2001 From: Rishi Kumar Date: Sun, 28 Jul 2024 16:10:23 +0530 Subject: [PATCH 3/3] chore: Remove duplicate env.JAVA_HOME --- src/modules/languages/clojure.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/languages/clojure.nix b/src/modules/languages/clojure.nix index 72375951c..2e8ba4dcf 100644 --- a/src/modules/languages/clojure.nix +++ b/src/modules/languages/clojure.nix @@ -16,7 +16,5 @@ in clojure-lsp ]; languages.java.enable = true; - - env.JAVA_HOME = config.languages.java.jdk.package.home; }; }