-
-
Save aaronjanse/1783a6197d28e0aeda0d9f402175daf6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, lib, buildGoModule, fetchFromGitHub, spotify-unwrapped }: | |
let | |
spicetify = buildGoModule rec { | |
pname = "spicetify-cli"; | |
version = "1.1.0"; | |
src = fetchFromGitHub { | |
owner = "khanhas"; | |
repo = pname; | |
rev = "v${version}"; | |
sha256 = "08rnwj7ggh114n3mhhm8hb8fm1njgb4j6vba3hynp8x1c2ngidff"; | |
}; | |
vendorSha256 = "0k06c3jw5z8rw8nk4qf794kyfipylmz6x6l126a2snvwi0lmc601"; | |
# used at runtime, but not installed by default | |
postInstall = '' | |
cp -r ${src}/jsHelper $out/bin/jsHelper | |
''; | |
doInstallCheck = true; | |
installCheckPhase = '' | |
$out/bin/spicetify-cli --help > /dev/null | |
''; | |
meta = with lib; { | |
description = "Command-line tool to customize Spotify client"; | |
homepage = "https://github.com/khanhas/spicetify-cli/"; | |
license = licenses.gpl3Plus; | |
maintainers = with maintainers; [ jonringer ]; | |
}; | |
}; | |
spiced = pkgs.stdenv.mkDerivation { | |
pname = "spotify-spiced"; | |
inherit (spotify-unwrapped) version; | |
src = pkgs.spotify-unwrapped; | |
doUnpackPhase = false; | |
phases = [ "unpackPhase" "buildPhase" ]; | |
buildPhase = '' | |
mkdir /tmp/spicetify-config | |
export XDG_CONFIG_HOME=/tmp/spicetify-config | |
${spicetify}/bin/spicetify-cli config spotify_path "$(pwd)"/share/spotify | |
touch /tmp/spicetify-config/prefs | |
${spicetify}/bin/spicetify-cli config prefs_path /tmp/spicetify-config/prefs | |
echo '-------- 1' | |
cat $(${spicetify}/bin/spicetify-cli -c) | |
echo '-------- 2' | |
ls /tmp/spicetify-config/spicetify/Themes | |
mkdir /tmp/spicetify-config/spicetify/Themes/SpicetifyDefault | |
cat << EOF > /tmp/spicetify-config/spicetify/Themes/SpicetifyDefault/color.ini | |
[Base] | |
; Pink on White background | |
;main_fg =FE6F61 | |
;secondary_fg =3D3D3D | |
;main_bg =FAFAFA | |
;sidebar_and_player_bg =FAFAFA | |
;cover_overlay_and_shadow =000000 | |
;indicator_fg_and_button_bg =FE6F61 | |
;pressing_fg = FF5C86 | |
;slider_bg =FAFAFA | |
;sidebar_indicator_and_hover_button_bg =FF6F61 | |
;scrollbar_fg_and_selected_row_bg =EBEBEB | |
;pressing_button_fg =DEDEDE | |
;pressing_button_bg =383145 | |
;selected_button =FE6F61 | |
;miscellaneous_bg =3F3C45 | |
;miscellaneous_hover_bg =383145 | |
;preserve_1 =FFFFFF | |
; Light green on Dark Blue background | |
main_fg =e9e9f4 | |
secondary_fg =DEDEDE | |
main_bg =282936 | |
sidebar_and_player_bg =282936 | |
cover_overlay_and_shadow =000000 | |
indicator_fg_and_button_bg =4d4f68 | |
pressing_fg = FF5C86 | |
slider_bg =3a3c4e | |
sidebar_indicator_and_hover_button_bg =e9e9f4 | |
scrollbar_fg_and_selected_row_bg =4d4f68 | |
pressing_button_fg =e9e9f4 | |
pressing_button_bg =3a3c4e | |
selected_button =00BF76 | |
miscellaneous_bg =3a3c4e | |
miscellaneous_hover_bg =3a3c4e | |
preserve_1 =FFFFFF | |
EOF | |
cat << EOF > /tmp/spicetify-config/spicetify/Themes/SpicetifyDefault/user.css | |
* { color: red; } | |
EOF | |
echo '-------- 3' | |
${spicetify}/bin/spicetify-cli backup apply | |
echo '-------- 4' | |
${spicetify}/bin/spicetify-cli apply | |
echo '-------- 5' | |
mkdir -p $out | |
sed -i "s#${spotify-unwrapped}#$out#g" ./bin/spotify | |
cp -r ./* $out | |
''; | |
}; | |
in pkgs.spotify.override { spotify-unwrapped = spiced; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment