From 9b8665b5325c6984f4eb244d9f419ceb0df8ce98 Mon Sep 17 00:00:00 2001 From: Ian McFarlane <70479099+the-argus@users.noreply.github.com> Date: Tue, 9 Aug 2022 14:35:33 +0000 Subject: [PATCH] v 1.1.0 - Major bug fixes - themes look good now! (#2) - Fixed customapps completely - Fixed all known broken extensions (lastfm, genre, full album date, play next) - Fixed broken themes such as Dribbblish (except for Turntable, which still appears to be broken) --- README.md | 33 ++++++++++++++++++++++++++------- module.nix | 22 ++++++++++++++++++++-- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8ab82cba..2a9f4492 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,21 @@ -# Warning: Spotify Sucks -Linux is a second class citizen on Spotify's release plan, but because it isn't FOSS, there's nothing we can do. Right now a lot of themes and extensions don't work because spotify isn't up to date on Linux. This includes Dribbblish :( +# ~~Warning: Spotify Sucks~~ +~~Linux is a second class citizen on Spotify's release plan, but because it isn't FOSS, there's nothing we can do. Right now a lot of themes and extensions don't work because spotify isn't up to date on Linux. This includes Dribbblish :(~~ +# EDIT: nevermind +Turns out using spicetify 2.9.9 and the most recent CSS map fixes most (or all) of the issues. Use the following configuration option to get spicetify 2.9.9: +```nix +{ + programs.spicetify.spicetifyPackage = pkgs.spicetify-cli.overrideAttrs (oa: rec { + pname = "spicetify-cli"; + version = "2.9.9"; + src = pkgs.fetchgit { + url = "https://github.com/spicetify/${pname}"; + rev = "v${version}"; + sha256 = "1a6lqp6md9adxjxj4xpxj0j1b60yv3rpjshs91qx3q7blpsi3z4z"; + }; + }); +} +``` # Spicetify-Nix Modifies Spotify using [spicetify-cli](https://github.com/khanhas/spicetify-cli). @@ -35,8 +50,6 @@ Here are two examples of files which configures spicetify when imported into a u programs.spicetify = { enable = true; - # recommended to use newest version of spicetify unless you know what you're doing - spicetifyPackage = unstable.spicetify-cli; theme = "catppuccin-mocha"; # OR # theme = spicetify-nix.pkgs.themes.catppuccin-mocha; @@ -52,7 +65,6 @@ Here are two examples of files which configures spicetify when imported into a u ``` ### MAXIMUM CONFIGURATION -WARNING: Do not copy + paste this configuration. The "enabledCustomApps" causes spotify to give the "something went wrong" page eternally. This configuration is only meant as an example. ```nix { pkgs, unstable, lib, spicetify-nix, ... }: { @@ -85,7 +97,15 @@ WARNING: Do not copy + paste this configuration. The "enabledCustomApps" causes # use spotify from the nixpkgs master branch spotifyPackage = unstable.spotify-unwrapped; # use a custom build of spicetify, also an old version. - spicetifyPackage = import ../../packages/spicetify-cli-2.9.9.nix { inherit pkgs; }; + spicetifyPackage = pkgs.spicetify-cli.overrideAttrs (oa: rec { + pname = "spicetify-cli"; + version = "2.9.9"; + src = pkgs.fetchgit { + url = "https://github.com/spicetify/${pname}"; + rev = "v${version}"; + sha256 = "1a6lqp6md9adxjxj4xpxj0j1b60yv3rpjshs91qx3q7blpsi3z4z"; + }; + }); # actually enable the installation of spotify and spicetify enable = true; @@ -138,7 +158,6 @@ WARNING: Do not copy + paste this configuration. The "enabledCustomApps" causes misc = "6e6a86"; }; - # BROKEN AT TIME OF WRITING enabledCustomApps = with spicetify-nix.pkgs.apps; [ new-releases { diff --git a/module.nix b/module.nix index 85b087de..9596d871 100644 --- a/module.nix +++ b/module.nix @@ -79,6 +79,14 @@ in type = lib.types.nullOr lib.types.attrs; default = null; }; + + cssMap = mkOption { + type = lib.types.path; + default = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/spicetify/spicetify-cli/6f473f28151c75e08e83fb280dd30fadd22d9c04/css-map.json"; + sha256 = "1qj0hlq98hz4v318qhz6ijyrir96fj962gqz036dm4jka3bg06l7"; + }; + }; }; config = @@ -101,7 +109,7 @@ in allApps = map spiceLib.getApp (cfg.enabledCustomApps ++ cfg.xpui.AdditionalOptions.custom_apps); allAppsNames = map (item: item.name) allApps; customAppsString = pipeConcat allAppsNames; - + # cfg.theme.injectCss is a submodule but cfg.injectCss is not, so we # have to have two different override functions for each case # (one value is null while the other is undefined...) @@ -182,7 +190,7 @@ in "${item.src}")} ./CustomApps/${item.name}") allApps); - spicetify = "${cfg.spicetifyPackage}/bin/spicetify-cli --no-restart"; + spicetify = "spicetify-cli --no-restart"; theme = spiceLib.getTheme cfg.theme; themePath = spiceLib.getThemePath theme; @@ -204,6 +212,16 @@ in finalScript = '' export SPICETIFY_CONFIG=$out/spicetify mkdir -p $SPICETIFY_CONFIG + + # move spicetify bin here + cp ${cfg.spicetifyPackage}/bin/spicetify-cli $SPICETIFY_CONFIG/spicetify-cli + ${pkgs.coreutils-full}/bin/chmod +x $SPICETIFY_CONFIG/spicetify-cli + cp -r ${cfg.spicetifyPackage}/bin/jsHelper $SPICETIFY_CONFIG/jsHelper + # grab the css map + cp -r ${cfg.cssMap} $SPICETIFY_CONFIG/css-map.json + # add the current directory to path + export PATH=$SPICETIFY_CONFIG:$PATH + pushd $SPICETIFY_CONFIG # create config and prefs