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>
wip/nixpkgs-raku
Philippe Hürlimann 3 years ago committed by GitHub
parent 871fda6729
commit 4fecb8b2d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      nixos/modules/services/misc/airsonic.nix

@ -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…
Cancel
Save