├── .vscode └── settings.json ├── LICENSE ├── README.md ├── module.nix ├── package.nix ├── spicetify.nix ├── themes-src.nix └── update.sh /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "nixEnvSelector.nixShellConfig": "NOT_MODIFIED_ENV" 3 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Piet de Vries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRICATED 2 | 3 | I have not worked on this project for a long while, due to personal reasons. Thankfully the-argus has made a fork with in his own words the next features: 4 | 5 | > It supplies a home manager module to flake-based configurations, as well as packaging for many different themes and extensions. If you are trying to get spicetify working on NixOS, use that. 6 | 7 | Please start using it here: https://github.com/the-argus/spicetify-nix 8 | 9 | # Spicetify-Nix 10 | 11 | Modifies Spotify using [spicetify-cli](https://github.com/khanhas/spicetify-cli). 12 | 13 | [spicetify-themes](https://github.com/morpheusthewhite/spicetify-themes) are included and available, including Dribblish. 14 | 15 | Usage as a home-manager module: 16 | ```nix 17 | let 18 | av = pkgs.fetchFromGitHub { 19 | owner = "amanharwara"; 20 | repo = "spicetify-autoVolume"; 21 | rev = "d7f7962724b567a8409ef2898602f2c57abddf5a"; 22 | sha256 = "1pnya2j336f847h3vgiprdys4pl0i61ivbii1wyb7yx3wscq7ass"; 23 | }; 24 | 25 | # fetchFromGitHub should work too 26 | spicetify = fetchTarball https://github.com/pietdevries94/spicetify-nix/archive/master.tar.gz; 27 | in 28 | # The module is meant to be imported by the user 29 | home-manager.users.piet = { 30 | imports = [ (import "${spicetify}/module.nix") ]; 31 | 32 | programs.spicetify = { 33 | enable = true; 34 | theme = "Dribbblish"; 35 | colorScheme = "horizon"; 36 | enabledCustomApps = ["reddit"]; 37 | enabledExtensions = ["newRelease.js" "autoVolume.js"]; 38 | thirdParyExtensions = { 39 | "autoVolume.js" = "${av}/autoVolume.js"; 40 | }; 41 | }; 42 | } 43 | ``` 44 | 45 | Usage as a package: 46 | ```nix 47 | let 48 | av = pkgs.fetchFromGitHub { 49 | owner = "amanharwara"; 50 | repo = "spicetify-autoVolume"; 51 | rev = "d7f7962724b567a8409ef2898602f2c57abddf5a"; 52 | sha256 = "1pnya2j336f847h3vgiprdys4pl0i61ivbii1wyb7yx3wscq7ass"; 53 | }; 54 | 55 | spicetify = fetchTarball https://github.com/pietdevries94/spicetify-nix/archive/master.tar.gz; 56 | in 57 | pkgs.callPackage (import "${spicetify}/package.nix") { 58 | inherit pkgs; 59 | theme = "Dribbblish"; 60 | colorScheme = "horizon"; 61 | enabledCustomApps = ["reddit"]; 62 | enabledExtensions = ["newRelease.js" "autoVolume.js"]; 63 | thirdParyExtensions = { 64 | "autoVolume.js" = "${av}/autoVolume.js"; 65 | }; 66 | } 67 | ``` 68 | 69 | To add third-party themes, extensions or custom apps use `thirdParyThemes`, `thirdParyExtensions` or `thirdParyCustomApps`. These expect a set, where the key is the name of the new theme/extension and the value the path. Don't forget to enable it seperatly. 70 | 71 | For all available options, check module.nix or package.nix and the spicetify repo. Everything is optional and will revert to the defaults from spicetify. 72 | 73 | ## macOS 74 | This package has no macOS support, because Spotify in nixpkgs has no macOS support. 75 | -------------------------------------------------------------------------------- /module.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, config, ... }: 2 | with lib; 3 | let 4 | cfg = config.programs.spicetify; 5 | in { 6 | options.programs.spicetify = { 7 | enable = mkEnableOption "A modded Spotify"; 8 | theme = mkOption { 9 | type = types.str; 10 | default = "SpicetifyDefault"; 11 | }; 12 | colorScheme = mkOption { 13 | type = types.str; 14 | default = ""; 15 | }; 16 | thirdParyThemes = mkOption { 17 | type = types.attrs; 18 | default = {}; 19 | }; 20 | thirdParyExtensions = mkOption { 21 | type = types.attrs; 22 | default = {}; 23 | }; 24 | thirdParyCustomApps = mkOption { 25 | type = types.attrs; 26 | default = {}; 27 | }; 28 | enabledExtensions = mkOption { 29 | type = types.listOf types.str; 30 | default = []; 31 | }; 32 | enabledCustomApps = mkOption { 33 | type = types.listOf types.str; 34 | default = []; 35 | }; 36 | spotifyLaunchFlags = mkOption { 37 | type = types.str; 38 | default = ""; 39 | }; 40 | injectCss = mkOption { 41 | type = types.bool; 42 | default = false; 43 | }; 44 | replaceColors = mkOption { 45 | type = types.bool; 46 | default = false; 47 | }; 48 | overwriteAssets = mkOption { 49 | type = types.bool; 50 | default = false; 51 | }; 52 | disableSentry = mkOption { 53 | type = types.bool; 54 | default = true; 55 | }; 56 | disableUiLogging = mkOption { 57 | type = types.bool; 58 | default = true; 59 | }; 60 | removeRtlRule = mkOption { 61 | type = types.bool; 62 | default = true; 63 | }; 64 | exposeApis = mkOption { 65 | type = types.bool; 66 | default = true; 67 | }; 68 | disableUpgradeCheck = mkOption { 69 | type = types.bool; 70 | default = true; 71 | }; 72 | fastUserSwitching = mkOption { 73 | type = types.bool; 74 | default = false; 75 | }; 76 | visualizationHighFramerate = mkOption { 77 | type = types.bool; 78 | default = false; 79 | }; 80 | radio = mkOption { 81 | type = types.bool; 82 | default = false; 83 | }; 84 | songPage = mkOption { 85 | type = types.bool; 86 | default = false; 87 | }; 88 | experimentalFeatures = mkOption { 89 | type = types.bool; 90 | default = false; 91 | }; 92 | home = mkOption { 93 | type = types.bool; 94 | default = false; 95 | }; 96 | lyricAlwaysShow = mkOption { 97 | type = types.bool; 98 | default = false; 99 | }; 100 | lyricForceNoSync = mkOption { 101 | type = types.bool; 102 | default = false; 103 | }; 104 | }; 105 | 106 | config = mkIf cfg.enable { 107 | home.packages = [ 108 | (pkgs.callPackage ./package.nix { 109 | inherit pkgs; 110 | inherit (cfg) 111 | theme 112 | colorScheme 113 | thirdParyThemes 114 | thirdParyExtensions 115 | thirdParyCustomApps 116 | enabledExtensions 117 | enabledCustomApps 118 | spotifyLaunchFlags 119 | injectCss 120 | replaceColors 121 | overwriteAssets 122 | disableSentry 123 | disableUiLogging 124 | removeRtlRule 125 | exposeApis 126 | disableUpgradeCheck 127 | fastUserSwitching 128 | visualizationHighFramerate 129 | radio 130 | songPage 131 | experimentalFeatures 132 | home 133 | lyricAlwaysShow 134 | lyricForceNoSync 135 | ; 136 | }) 137 | ]; 138 | }; 139 | } -------------------------------------------------------------------------------- /package.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs ? import {}, 3 | theme ? "SpicetifyDefault", 4 | colorScheme ? "", 5 | thirdParyThemes ? {}, 6 | thirdParyExtensions ? {}, 7 | thirdParyCustomApps ? {}, 8 | enabledExtensions ? [], 9 | enabledCustomApps ? [], 10 | spotifyLaunchFlags ? "", 11 | injectCss ? false, 12 | replaceColors ? false, 13 | overwriteAssets ? false, 14 | disableSentry ? true, 15 | disableUiLogging ? true, 16 | removeRtlRule ? true, 17 | exposeApis ? true, 18 | disableUpgradeCheck ? true, 19 | fastUserSwitching ? false, 20 | visualizationHighFramerate ? false, 21 | radio ? false, 22 | songPage ? false, 23 | experimentalFeatures ? false, 24 | home ? false, 25 | lyricAlwaysShow ? false, 26 | lyricForceNoSync ? false 27 | }: 28 | 29 | let 30 | inherit (pkgs.lib.lists) foldr; 31 | inherit (pkgs.lib.attrsets) mapAttrsToList; 32 | 33 | # Helper functions 34 | pipeConcat = foldr (a: b: a + "|" + b) ""; 35 | lineBreakConcat = foldr (a: b: a + "\n" + b) ""; 36 | boolToString = x: if x then "1" else "0"; 37 | makeLnCommands = type: (mapAttrsToList (name: path: "ln -sf ${path} ./${type}/${name}")); 38 | 39 | # Setup spicetify 40 | spicetifyPkg = pkgs.callPackage ./spicetify.nix {}; 41 | spicetify = "SPICETIFY_CONFIG=. ${spicetifyPkg}/spicetify"; 42 | 43 | themes = import ./themes-src.nix; 44 | 45 | # Dribblish is a theme which needs a couple extra settings 46 | isDribblish = theme == "Dribbblish"; 47 | 48 | extraCommands = (if isDribblish then "cp ./Themes/Dribbblish/dribbblish.js ./Extensions \n" else "") 49 | + (lineBreakConcat (makeLnCommands "Themes" thirdParyThemes)) 50 | + (lineBreakConcat (makeLnCommands "Extensions" thirdParyExtensions)) 51 | + (lineBreakConcat (makeLnCommands "CustomApps" thirdParyCustomApps)); 52 | 53 | customAppsFixupCommands = lineBreakConcat (makeLnCommands "Apps" thirdParyCustomApps); 54 | 55 | injectCssOrDribblish = boolToString (isDribblish || injectCss); 56 | replaceColorsOrDribblish = boolToString (isDribblish || replaceColors); 57 | overwriteAssetsOrDribblish = boolToString (isDribblish || overwriteAssets); 58 | 59 | extensionString = pipeConcat ((if isDribblish then [ "dribbblish.js" ] else []) ++ enabledExtensions); 60 | customAppsString = pipeConcat enabledCustomApps; 61 | in 62 | pkgs.spotify-unwrapped.overrideAttrs (oldAttrs: rec { 63 | postInstall='' 64 | touch $out/prefs 65 | mkdir Themes 66 | mkdir Extensions 67 | mkdir CustomApps 68 | 69 | find ${themes} -maxdepth 1 -type d -exec ln -s {} Themes \; 70 | ${extraCommands} 71 | 72 | ${spicetify} config \ 73 | spotify_path "$out/share/spotify" \ 74 | prefs_path "$out/prefs" \ 75 | current_theme ${theme} \ 76 | ${if 77 | colorScheme != "" 78 | then 79 | ''color_scheme "${colorScheme}" \'' 80 | else 81 | ''\'' } 82 | ${if 83 | extensionString != "" 84 | then 85 | ''extensions "${extensionString}" \'' 86 | else 87 | ''\'' } 88 | ${if 89 | customAppsString != "" 90 | then 91 | ''custom_apps "${customAppsString}" \'' 92 | else 93 | ''\'' } 94 | ${if 95 | spotifyLaunchFlags != "" 96 | then 97 | ''spotify_launch_flags "${spotifyLaunchFlags}" \'' 98 | else 99 | ''\'' } 100 | inject_css ${injectCssOrDribblish} \ 101 | replace_colors ${replaceColorsOrDribblish} \ 102 | overwrite_assets ${overwriteAssetsOrDribblish} \ 103 | disable_sentry ${boolToString disableSentry } \ 104 | disable_ui_logging ${boolToString disableUiLogging } \ 105 | remove_rtl_rule ${boolToString removeRtlRule } \ 106 | expose_apis ${boolToString exposeApis } \ 107 | disable_upgrade_check ${boolToString disableUpgradeCheck } \ 108 | fastUser_switching ${boolToString fastUserSwitching } \ 109 | visualization_high_framerate ${boolToString visualizationHighFramerate } \ 110 | radio ${boolToString radio } \ 111 | song_page ${boolToString songPage } \ 112 | experimental_features ${boolToString experimentalFeatures } \ 113 | home ${boolToString home } \ 114 | lyric_always_show ${boolToString lyricAlwaysShow } \ 115 | lyric_force_no_sync ${boolToString lyricForceNoSync } 116 | 117 | ${spicetify} backup apply 118 | 119 | cd $out/share/spotify 120 | ${customAppsFixupCommands} 121 | ''; 122 | }) 123 | -------------------------------------------------------------------------------- /spicetify.nix: -------------------------------------------------------------------------------- 1 | { stdenv, pkgs }: 2 | 3 | stdenv.mkDerivation rec { 4 | name = "spicetify-1.1.0"; 5 | 6 | src = pkgs.fetchurl { 7 | name = "spicetify-1.1.0-linux-amd64.tar.gz"; 8 | url = https://github.com/khanhas/spicetify-cli/releases/download/v1.1.0/spicetify-1.1.0-linux-amd64.tar.gz; 9 | sha256 = "sha256:0jsxzw7vzalixi70pps7dq40l5sxwf5ynmr5ycbjzwr4vxdhv0d7"; 10 | }; 11 | 12 | sourceRoot = "."; 13 | 14 | installPhase = '' 15 | mkdir -p $out 16 | cp -r * $out 17 | ''; 18 | } -------------------------------------------------------------------------------- /themes-src.nix: -------------------------------------------------------------------------------- 1 | let 2 | pkgs = import {}; 3 | in 4 | pkgs.fetchFromGitHub { 5 | owner = "morpheusthewhite"; 6 | repo = "spicetify-themes"; 7 | rev = "fdadc4c1cfe38ecd22cf828d2c825e0af1dcda9f"; 8 | sha256 = "1k44g8rmf8bh4kk16w4n9z1502ag3w67ad3jx28327ykq8pq5w29"; 9 | fetchSubmodules = true; 10 | } -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nix-shell 2 | #!nix-shell -i bash -p nix-prefetch-github 3 | 4 | rm themes-src.nix 5 | nix-prefetch-github --nix --rev master morpheusthewhite spicetify-themes > themes-src.nix --------------------------------------------------------------------------------