2017-01-07 19:16:26 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.eclipse;
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2017-09-26 23:40:31 +02:00
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
options = {
|
|
|
|
programs.eclipse = {
|
|
|
|
enable = mkEnableOption "Eclipse";
|
|
|
|
|
2020-06-08 02:35:28 +02:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.eclipses.eclipse-platform;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.eclipses.eclipse-platform";
|
|
|
|
example = literalExpression "pkgs.eclipses.eclipse-java";
|
2020-06-08 02:35:28 +02:00
|
|
|
description = ''
|
|
|
|
The Eclipse package to install.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-01-09 22:03:13 +01:00
|
|
|
enableLombok = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the Lombok Java Agent in Eclipse. This is
|
|
|
|
necessary to use the Lombok class annotations.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
jvmArgs = mkOption {
|
|
|
|
type = types.listOf types.str;
|
2020-02-02 00:39:17 +01:00
|
|
|
default = [ ];
|
2017-01-07 19:16:26 +01:00
|
|
|
description = "JVM arguments to use for the Eclipse process.";
|
|
|
|
};
|
|
|
|
|
|
|
|
plugins = mkOption {
|
|
|
|
type = types.listOf types.package;
|
2020-02-02 00:39:17 +01:00
|
|
|
default = [ ];
|
2017-01-07 19:16:26 +01:00
|
|
|
description = "Plugins that should be added to Eclipse.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [
|
|
|
|
(pkgs.eclipses.eclipseWithPlugins {
|
2020-06-08 02:35:28 +02:00
|
|
|
eclipse = cfg.package;
|
2020-02-02 00:39:17 +01:00
|
|
|
jvmArgs = cfg.jvmArgs ++ optional cfg.enableLombok
|
|
|
|
"-javaagent:${pkgs.lombok}/share/java/lombok.jar";
|
2017-01-07 19:16:26 +01:00
|
|
|
plugins = cfg.plugins;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|