1{ lib, buildGoModule, fetchFromGitHub, testers, spicetify-cli }:
2
3buildGoModule rec {
4 pname = "spicetify-cli";
5 version = "2.27.1";
6
7 src = fetchFromGitHub {
8 owner = "spicetify";
9 repo = "spicetify-cli";
10 rev = "v${version}";
11 hash = "sha256-Z+paJAuzUnCdCSx2UHg1HV14vDo3jWsyUrcbEnvqTm0=";
12 };
13
14 vendorHash = "sha256-H2kSTsYiD9HResHes+7YxUyNcjtM0SLpDPUC0Y518VM=";
15
16 ldflags = [
17 "-s -w"
18 "-X 'main.version=${version}'"
19 ];
20
21 # used at runtime, but not installed by default
22 postInstall = ''
23 cp -r ${src}/jsHelper $out/bin/jsHelper
24 cp -r ${src}/CustomApps $out/bin/CustomApps
25 cp -r ${src}/Extensions $out/bin/Extensions
26 cp -r ${src}/Themes $out/bin/Themes
27 '';
28
29 doInstallCheck = true;
30 installCheckPhase = ''
31 $out/bin/spicetify-cli --help > /dev/null
32 '';
33
34 passthru.tests.version = testers.testVersion {
35 package = spicetify-cli;
36 command = "spicetify-cli -v";
37 };
38
39 meta = with lib; {
40 description = "Command-line tool to customize Spotify client";
41 homepage = "https://github.com/spicetify/spicetify-cli/";
42 license = licenses.gpl3Plus;
43 maintainers = with maintainers; [ jonringer mdarocha ];
44 mainProgram = "spicetify-cli";
45 };
46}