fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1# This module provides JAVA_HOME, with a different way to install java locally. 2# This module is modified from the NixOS module `programs.java` 3 4{ config , lib , pkgs , ...} : 5 6with lib ; 7 8let 9 10cfg = config . programs . java ; 11 12in { 13meta . maintainers = with maintainers ; [ ShamrockLee ]; 14 15options = { 16programs . java = { 17enable = mkEnableOption "" // { 18description = '' 19Install the Java development kit and set the 20{env}`JAVA_HOME` variable. 21'' ; 22}; 23 24package = mkOption { 25type = types . package ; 26default = pkgs . jdk ; 27defaultText = "pkgs.jdk" ; 28description = '' 29Java package to install. Typical values are 30`pkgs.jdk` or `pkgs.jre`. 31'' ; 32}; 33}; 34}; 35 36config = mkIf cfg . enable { 37home . packages = [ cfg . package ]; 38 39# some instances of `jdk-linux-base.nix` pass through `result` without turning it onto a path-string. 40# while I suspect this is incorrect, the documentation is unclear. 41home . sessionVariables . JAVA_HOME = " ${ cfg . package . home } " ; 42}; 43}