fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge branch 'literalExpression' [#2371]4fa1ba72

master
1.4 KiB60 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.eclipse;
8
9in {
10  meta.maintainers = [ maintainers.rycee ];
11
12  options = {
13    programs.eclipse = {
14      enable = mkEnableOption "Eclipse";
15
16      package = mkOption {
17        type = types.package;
18        default = pkgs.eclipses.eclipse-platform;
19        defaultText = literalExpression "pkgs.eclipses.eclipse-platform";
20        example = literalExpression "pkgs.eclipses.eclipse-java";
21        description = ''
22          The Eclipse package to install.
23        '';
24      };
25
26      enableLombok = mkOption {
27        type = types.bool;
28        default = false;
29        example = true;
30        description = ''
31          Whether to enable the Lombok Java Agent in Eclipse. This is
32          necessary to use the Lombok class annotations.
33        '';
34      };
35
36      jvmArgs = mkOption {
37        type = types.listOf types.str;
38        default = [ ];
39        description = "JVM arguments to use for the Eclipse process.";
40      };
41
42      plugins = mkOption {
43        type = types.listOf types.package;
44        default = [ ];
45        description = "Plugins that should be added to Eclipse.";
46      };
47    };
48  };
49
50  config = mkIf cfg.enable {
51    home.packages = [
52      (pkgs.eclipses.eclipseWithPlugins {
53        eclipse = cfg.package;
54        jvmArgs = cfg.jvmArgs ++ optional cfg.enableLombok
55          "-javaagent:${pkgs.lombok}/share/java/lombok.jar";
56        plugins = cfg.plugins;
57      })
58    ];
59  };
60}