From b9df2f3a0cba1027d4dd958958ab188a5de20cdb Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 17 Mar 2025 01:33:41 +1100 Subject: [PATCH] user/spicetify: bring back with updates --- flake.lock | 37 +++++++++++++++++++++++++++++++ flake.nix | 2 ++ modules/user/spicetify.nix | 45 ++++++++++++++++++++++---------------- users/rin/wayland.nix | 2 ++ 4 files changed, 67 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index 3af226e..15c58b3 100644 --- a/flake.lock +++ b/flake.lock @@ -678,6 +678,7 @@ "nixpkgs": "nixpkgs_3", "nvim-treesitter": "nvim-treesitter", "pure": "pure", + "spicetify-nix": "spicetify-nix", "spotify-adblock": "spotify-adblock", "tree-sitter-jsonc": "tree-sitter-jsonc", "wine-discord-ipc-bridge": "wine-discord-ipc-bridge", @@ -685,6 +686,27 @@ "zsh-history-substring-search": "zsh-history-substring-search" } }, + "spicetify-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1742098581, + "narHash": "sha256-c8pnJi/Y8+whPi5aOs5qKshfh4vvRUqczaJIOc6Xdv8=", + "owner": "Gerg-L", + "repo": "spicetify-nix", + "rev": "4b285681a73e73c4f961fb69163c0daa36a18d30", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "spicetify-nix", + "type": "github" + } + }, "spotify-adblock": { "flake": false, "locked": { @@ -731,6 +753,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tree-sitter-jsonc": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 083448c..b728f33 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,8 @@ neovim-nightly.inputs.nixpkgs.follows = "nixpkgs"; nix-gaming.url = "github:fufexan/nix-gaming"; + spicetify-nix.url = "github:Gerg-L/spicetify-nix"; + spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; # services # hosts-blocklists = { url = "github:notracking/hosts-blocklists"; flake = false; }; diff --git a/modules/user/spicetify.nix b/modules/user/spicetify.nix index 8158246..c8e0b53 100644 --- a/modules/user/spicetify.nix +++ b/modules/user/spicetify.nix @@ -1,34 +1,41 @@ { config, inputs, pkgs, ... }: let - spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; - #adblock = inputs.spotify-adblock.defaultPackage.x86_64-linux; - adblock = pkgs.me.spotify-adblock; + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; in { - imports = [ inputs.spicetify-nix.homeManagerModule ]; + imports = [ inputs.spicetify-nix.homeManagerModules.spicetify ]; programs.spicetify = { - spotifyPackage = pkgs.spotify-unwrapped.overrideAttrs(o: { - installPhase = pkgs.lib.replaceStrings ["--prefix PATH"] [ - ''--prefix SPOTIFY_ADBLOCK_CONFIG : ${adblock}/lib/config.toml \ - --prefix LD_PRELOAD : ${adblock}/lib/libspotifyadblock.so \ - --prefix PATH''] o.installPhase; - }); - enable = true; - theme = spicePkgs.themes.Dribbblish // { - #src = inputs.spicetify-themes; - extraCommands = "spicetify-cli --no-restart config experimental_features 1"; - #requiredExtensions = [((builtins.head spicePkgs.themes.Dribbblish.requiredExtensions) // { filename = "theme.js"; }) ]; + theme = spicePkgs.themes.dribbblish // rec { + src = pkgs.stdenvNoCC.mkDerivation { + pname = "spicetify-dribbblish-catppuccin-patch"; + version = "1.0.0"; + dontUnpack = true; + installPhase = let + color_prev1 = builtins.replaceStrings ["#"] [""] config.catppuccin.hexcolors.overlay1; + color_prev2 = builtins.replaceStrings ["#"] [""] config.catppuccin.hexcolors.overlay2; + color_next = builtins.replaceStrings ["#"] [""] config.catppuccin.hexcolors.${config.catppuccin.accent}; + color_sidebar_prev = builtins.replaceStrings ["#"] [""] config.catppuccin.hexcolors.mantle; + color_sidebar_next = builtins.replaceStrings ["#"] [""] config.catppuccin.hexcolors.crust; + in '' + cp -r ${spicePkgs.themes.dribbblish.src} $out + substituteInPlace $out/color.ini \ + --replace-fail "${color_prev1}" "${color_next}" \ + --replace-fail "${color_prev2}" "${color_next}" \ + --replace-fail "sidebar = ${color_sidebar_prev}" \ + "sidebar = ${color_sidebar_next}" + ''; + }; }; - colorScheme = "purple"; + colorScheme = "catppuccin-${config.catppuccin.flavor}"; enabledCustomApps = with spicePkgs.apps; [ - lyrics-plus + lyricsPlus ]; enabledExtensions = with spicePkgs.extensions; [ - fullAppDisplayMod - shuffle # shuffle+ (special characters are sanitized out of ext names) + fullAppDisplay + shuffle hidePodcasts skipStats diff --git a/users/rin/wayland.nix b/users/rin/wayland.nix index edbcfda..4301173 100644 --- a/users/rin/wayland.nix +++ b/users/rin/wayland.nix @@ -38,6 +38,8 @@ dunst eww-wayland + + spicetify ]; services.mpris-proxy.enable = true;