Skip to content

Commit

Permalink
Refine cfg.home and use it when writing files
Browse files Browse the repository at this point in the history
Co-authored-by: Olli Helenius <[email protected]>
  • Loading branch information
britter and liff authored Dec 7, 2023
1 parent e06824d commit bcc4b73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/programs/gradle.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ in {
type = types.nullOr types.path;
default = null;
description = ''
The Gradle home directory.
The Gradle home directory, relative to `home.homeDirectory`.
If set, the GRADLE_USER_HOME environment variable will be
set accordingly. Defaults to null which results in ~/.gradle
Expand Down Expand Up @@ -66,11 +66,11 @@ in {
};
in mkIf cfg.enable {
home.packages = [ cfg.package ];
home.file.".gradle/init.d" =
home.file."${cfg.home}/init.d" =
mkIf (cfg.initScripts != { }) { source = "${initScripts}/init.d"; };
home.sessionVariables =
mkIf (cfg.home != null) { GRADLE_USER_HOME = cfg.home; };
home.file.".gradle/gradle.properties" = mkIf (cfg.settings != { }) {
home.file."${cfg.home}/gradle.properties" = mkIf (cfg.settings != { }) {
source = (settingsFormat.generate "gradle.properties" cfg.settings);
};
programs.java.enable = true;
Expand Down

0 comments on commit bcc4b73

Please sign in to comment.