mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 07:48:58 +00:00
nixos/airsonic: make path to war file and jre configurable (#135709)
* nixos/airsonic: make path to war file and jre configurable * Apply suggestions from code review Co-authored-by: Sumner Evans <me@sumnerevans.com> Co-authored-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
871fda6729
commit
4fecb8b2d0
|
@ -82,6 +82,25 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
jre = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.jre8;
|
||||
defaultText = literalExample "pkgs.jre8";
|
||||
description = ''
|
||||
JRE package to use.
|
||||
|
||||
Airsonic only supports Java 8, airsonic-advanced requires at least
|
||||
Java 11.
|
||||
'';
|
||||
};
|
||||
|
||||
war = mkOption {
|
||||
type = types.path;
|
||||
default = "${pkgs.airsonic}/webapps/airsonic.war";
|
||||
defaultText = "\${pkgs.airsonic}/webapps/airsonic.war";
|
||||
description = "Airsonic war file to use.";
|
||||
};
|
||||
|
||||
jvmOptions = mkOption {
|
||||
description = ''
|
||||
Extra command line options for the JVM running AirSonic.
|
||||
|
@ -118,7 +137,7 @@ in {
|
|||
'';
|
||||
serviceConfig = {
|
||||
ExecStart = ''
|
||||
${pkgs.jre8}/bin/java -Xmx${toString cfg.maxMemory}m \
|
||||
${cfg.jre}/bin/java -Xmx${toString cfg.maxMemory}m \
|
||||
-Dairsonic.home=${cfg.home} \
|
||||
-Dserver.address=${cfg.listenAddress} \
|
||||
-Dserver.port=${toString cfg.port} \
|
||||
|
@ -128,7 +147,7 @@ in {
|
|||
"-Dserver.use-forward-headers=true"} \
|
||||
${toString cfg.jvmOptions} \
|
||||
-verbose:gc \
|
||||
-jar ${pkgs.airsonic}/webapps/airsonic.war
|
||||
-jar ${cfg.war}
|
||||
'';
|
||||
Restart = "always";
|
||||
User = "airsonic";
|
||||
|
|
Loading…
Reference in a new issue