Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
add: airsonic-advanced
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlett authored and Skarlett committed Jul 23, 2023
1 parent dde2054 commit dfb54c1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions machines/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let
../modules/arl-scrape.nix
../modules/unallocatedspace.nix
../modules/project-zomboid.nix
../modules/airsonic-advanced.nix
inputs.coggiebot.nixosModules.coggiebot
inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default
Expand Down
22 changes: 22 additions & 0 deletions modules/airsonic-advanced.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.airsonic-advanced;
in
{
options.services.airsonic-advanced.enable = mkEnableOption "Enable airsonic-advanced";

config = mkIf cfg.enable {
services.airsonic = {
enable = true;
jre = pkgs.openjdk11;
maxMemory = 4096;
war = "${pkgs.self.airsonic-advanced-war.outPath}/webapps/airsonic.war";
jveOptions = [
"-server"
];
};

networking.firewall.allowedTCPPorts = [ config.services.airsonic.port ];
};
}
12 changes: 12 additions & 0 deletions packages/airsonic-advanced.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ airsonic, fetchurl }:
airsonic.overrideAttrs (final: prev: rec {
pname = "airsonic-advanced";
version = "10.6.0";

src = fetchurl {
url = "https://github.com/airsonic-advanced/airsonic-advanced/releases/download/v${version}/airsonic.war";
hash = "sha256-Uo9BfllJkWGtf9i4bTkePH7/cOCCVGXjFfhtNBdmTGk=";
};

meta.homepage = "https://github.com/airsonic-advanced";
})
2 changes: 2 additions & 0 deletions packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ self-lib.withSystem (system:
FQDN = "unallocatedspace.dev";
REDIRECT="https://github.com/skarlett";
};

packages.airsonic-advanced = pkgs.callPackage ./airsonic-advanced.nix {};
}

{ packages = builtins.removeAttrs (pkgs.callPackage ./pzserver {})
Expand Down

0 comments on commit dfb54c1

Please sign in to comment.