1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-27 12:19:48 +01:00
home-manager/tests/modules/programs/gradle/alternate-home-settings.nix
Benedikt Ritter 52cdf5acc5
gradle: add module
Introduces a new program called gradle for managing files stored in
the home directory by the [Gradle Build Tool](https://gradle.org).
Gradle uses the $HOME/.gradle folder for all it's configuration.

Features of the new program module are:

- Automatically setting programs.java.enable = true to make a Java
  installation available for running Gradle.
- Specifying an alternate Gradle home directory
- Setting of abitrary values for gradle.properties stored inside the
  Gradle home directory.
- Defining init scripts that will be linked into the init.d inside
  the Gradle home directory.

Co-authored-by: Olli Helenius <liff@iki.fi>
Co-authored-by: Robert Helgesson <robert@rycee.net>
2024-04-10 21:26:58 +02:00

26 lines
662 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.gradle = {
enable = true;
home = ".gbt";
settings = { "org.gradle.caching" = true; };
initScripts = { "some-script.gradle".text = "println 'hello world'"; };
};
programs.java.package =
pkgs.runCommandLocal "java" { home = ""; } "mkdir $out";
test.stubs.gradle = { };
nmt.script = ''
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export GRADLE_USER_HOME="/home/hm-user/.gbt"'
assertFileExists home-files/.gbt/gradle.properties
assertFileExists home-files/.gbt/init.d/some-script.gradle
'';
};
}