Skip to content

Commit

Permalink
gonic: update to v0.16.2
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Jan 4, 2024
1 parent da74d56 commit 451466d
Showing 1 changed file with 41 additions and 8 deletions.
49 changes: 41 additions & 8 deletions modules/services/gonic.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ config, lib, pkgs, ... }: with lib;
let
cfg = config.services.gonic2;
in
{
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.gonic2;
in {
# TODO convert this to just use the upstream Gonic module
options.services.gonic2 = {
enable = mkEnableOption "gonic, a Subsonic compatible music streaming server";
enable =
mkEnableOption "gonic, a Subsonic compatible music streaming server";
home = mkOption {
type = types.path;
description = "The root directory for Gonic data.";
Expand Down Expand Up @@ -50,7 +50,8 @@ in
};
scanInterval = mkOption {
type = types.nullOr types.int;
description = "interval (in minutes) to check for new music (automatic scanning disabled if null)";
description =
"interval (in minutes) to check for new music (automatic scanning disabled if null)";
default = null;
};
jukeboxEnabled = mkOption {
Expand All @@ -60,12 +61,44 @@ in
};
genreSplit = mkOption {
type = types.nullOr types.str;
description = "a string or character to split genre tags on for multi-genre support";
description =
"a string or character to split genre tags on for multi-genre support";
default = null;
};
};

config = mkIf cfg.enable {
nixpkgs.overlays = [
(final: prev: {
gonic = prev.gonic.overrideAttrs (old: {
version = "0.16.2";
src = pkgs.fetchFromGitHub {
owner = "sentriz";
repo = pname;
rev = "v${version}";
hash = "sha256-0KmE1tjWMeudNM3ARK5TZGNzjmC6luqYX/7ESvv7xAY=";
};

vendorHash = "sha256-0M1vlTt/4OKjn9Ocub+9HpeRcXt6Wf8aGa/ZqCdHh5M=";

# TODO(Profpatsch): write a test for transcoding support,
# since it is prone to break
postPatch = ''
substituteInPlace \
transcode/transcode.go \
--replace \
'`ffmpeg' \
'`${lib.getBin pkgs.ffmpeg}'
substituteInPlace \
jukebox/jukebox.go \
--replace \
'"mpv"' \
'"${lib.getBin pkgs.mpv}"'
'';
});
})
];

systemd.services.gonic = {
description = "Gonic service";
after = [ "network.target" ];
Expand Down

0 comments on commit 451466d

Please sign in to comment.