33 buildGoModule ,
44 fetchFromGitHub ,
55 testers ,
6+ replaceVars ,
67 spicetify-cli ,
78} :
8-
9- buildGoModule rec {
10- pname = "spicetify-cli" ;
9+ let
1110 version = "2.39.6" ;
11+ in
12+ buildGoModule {
13+ pname = "spicetify-cli" ;
14+ inherit version ;
1215
1316 src = fetchFromGitHub {
1417 owner = "spicetify" ;
1518 repo = "cli" ;
16- rev = "v${ version } " ;
19+ tag = "v${ version } " ;
1720 hash = "sha256-rdyHVHKVgl9fOviFYQuXY8Ko+/XwpKlKDfriQAgkusE=" ;
1821 } ;
1922
@@ -24,28 +27,41 @@ buildGoModule rec {
2427 "-X 'main.version=${ version } '"
2528 ] ;
2629
27- # used at runtime, but not installed by default
28- postInstall = ''
29- mv $out/bin/cli $out/bin/spicetify
30- ln -s $out/bin/spicetify $out/bin/spicetify-cli
31- cp -r ${ src } /jsHelper $out/bin/jsHelper
32- cp -r ${ src } /CustomApps $out/bin/CustomApps
33- cp -r ${ src } /Extensions $out/bin/Extensions
34- cp -r ${ src } /Themes $out/bin/Themes
35- '' ;
36-
37- doInstallCheck = true ;
38- installCheckPhase = ''
39- $out/bin/spicetify --help > /dev/null
40- '' ;
30+ patches = [
31+ # Stops spicetify from attempting to fetch a newer css-map.json
32+ ( replaceVars ./version.patch {
33+ inherit version ;
34+ } )
35+ ] ;
36+
37+ postInstall =
38+ /*
39+ jsHelper and css-map.json are required at runtime
40+ and are looked for in the directory of the spicetify binary
41+ so here we move spicetify to /share/spicetify
42+ so that css-map.json and jsHelper don't pollute PATH
43+ */
44+ ''
45+ mkdir -p $out/share/spicetify
46+
47+ cp -r $src/jsHelper $out/share/spicetify/jsHelper
48+ cp $src/css-map.json $out/share/spicetify/css-map.json
49+
50+ mv $out/bin/cli $out/share/spicetify/spicetify
51+
52+ ln -s $out/share/spicetify/spicetify $out/bin/spicetify
53+ '' ;
4154
4255 passthru . tests . version = testers . testVersion { package = spicetify-cli ; } ;
4356
44- meta = with lib ; {
57+ meta = {
4558 description = "Command-line tool to customize Spotify client" ;
4659 homepage = "https://github.com/spicetify/cli" ;
47- license = licenses . gpl3Plus ;
48- maintainers = [ maintainers . mdarocha ] ;
60+ license = lib . licenses . gpl3Plus ;
61+ maintainers = with lib . maintainers ; [
62+ mdarocha
63+ gerg-l
64+ ] ;
4965 mainProgram = "spicetify" ;
5066 } ;
5167}
0 commit comments