1 { lib, stdenv, buildGoModule, fetchFromGitHub
3 , pkg-config, taglib, zlib
5 # Disable on-the-fly transcoding,
6 # removing the dependency on ffmpeg.
7 # The server will (as of 0.11.0) gracefully fall back
8 # to the original file, but if transcoding is configured
9 # that takes a while. So best to disable all transcoding
10 # in the configuration if you disable transcodingSupport.
11 , transcodingSupport ? true, ffmpeg
17 src = fetchFromGitHub {
21 sha256 = "sha256-+8rKODoADU2k1quKvbijjs/6S/hpkegHhG7Si0LSE0k=";
24 nativeBuildInputs = [ pkg-config ];
25 buildInputs = [ taglib zlib ];
26 vendorHash = "sha256-6JkaiaAgtXYAZqVSRZJFObZvhEsHsbPaO9pwmKqIhYI=";
28 # TODO(Profpatsch): write a test for transcoding support,
29 # since it is prone to break
30 postPatch = lib.optionalString transcodingSupport ''
32 transcode/transcode.go \
35 '`${lib.getBin ffmpeg}/bin/ffmpeg'
41 '"${lib.getBin mpv}/bin/mpv"'
43 substituteInPlace server/ctrlsubsonic/testdata/test* \
50 tests.gonic = nixosTests.gonic;
54 homepage = "https://github.com/sentriz/gonic";
55 description = "Music streaming server / subsonic server API implementation";
56 license = lib.licenses.gpl3Plus;
57 maintainers = with lib.maintainers; [ autrimpo ];
58 platforms = lib.platforms.linux;
59 mainProgram = "gonic";