Test spotify-adblock
This commit is contained in:
		
							parent
							
								
									6c60d85ea6
								
							
						
					
					
						commit
						fff30c3314
					
				
					 4 changed files with 60 additions and 1 deletions
				
			
		|  | @ -38,6 +38,10 @@ | ||||||
|         allowUnfree = true; |         allowUnfree = true; | ||||||
|       }; |       }; | ||||||
| 
 | 
 | ||||||
|  |       sharedOverlays = [ | ||||||
|  |         (import ./overlays/spotify) | ||||||
|  |       ]; | ||||||
|  | 
 | ||||||
|       hostDefaults = { |       hostDefaults = { | ||||||
|         inherit system; |         inherit system; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,6 +2,7 @@ | ||||||
|     imports = [ |     imports = [ | ||||||
|         ./alacritty |         ./alacritty | ||||||
|         ./firefox |         ./firefox | ||||||
|  |         ./spotify | ||||||
|         ./steam |         ./steam | ||||||
|         ./thunderbird |         ./thunderbird | ||||||
|         # ./virtualbox |         # ./virtualbox | ||||||
|  | @ -19,7 +20,6 @@ | ||||||
|         obsidian |         obsidian | ||||||
|         pinentry_qt |         pinentry_qt | ||||||
|         qalculate-gtk |         qalculate-gtk | ||||||
|         spotify |  | ||||||
|         zathura |         zathura | ||||||
|         zoom-us |         zoom-us | ||||||
|       ]; |       ]; | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								nixos/modules/apps/spotify/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								nixos/modules/apps/spotify/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | { config, lib, pkgs, ... }: | ||||||
|  | 
 | ||||||
|  | { | ||||||
|  |   home-manager.users.tdpeuter = { | ||||||
|  |     home.packages = with pkgs; [ | ||||||
|  |       spotify | ||||||
|  |       spotify-adblock | ||||||
|  |     ]; | ||||||
|  | 
 | ||||||
|  |     # Set the desktop entry to use adblock. | ||||||
|  |     # TODO Is it possible to inherit all other values? | ||||||
|  |     xdg.desktopEntries.spotify = { | ||||||
|  |       name = "Spotify"; | ||||||
|  |       exec = "LD_PRELOAD=${pkgs.spotify-adblock}/lib/libspotifyadblock.so spotify %U"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										38
									
								
								nixos/overlays/spotify/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								nixos/overlays/spotify/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | ||||||
|  | final: prev: { | ||||||
|  |   spotify-adblock = final.rustPlatform.buildRustPackage rec { | ||||||
|  |     name = "spotify-adblock"; | ||||||
|  |     version = "v1.0.3"; | ||||||
|  |     src = final.fetchFromGitHub { | ||||||
|  |       owner = "abba23"; | ||||||
|  |       repo = "spotify-adblock"; | ||||||
|  |       rev = "5a3281d"; | ||||||
|  |       sha256 = "sha256-UzpHAHpQx2MlmBNKm2turjeVmgp5zXKWm3nZbEo0mYE="; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     cargoHash = "sha256-oHfk68mAIcmOenW7jn71Xpt8hWVDtxyInWhVN2rH+kk="; | ||||||
|  | 
 | ||||||
|  |     buildInputs = with final; [ | ||||||
|  |       cargo | ||||||
|  |       rustc | ||||||
|  |     ]; | ||||||
|  |   }; | ||||||
|  | #  spotify-wrapper = final.writeScriptBin "spotify-with-adblock" '' | ||||||
|  | #    #!/bin/sh | ||||||
|  | #    LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify | ||||||
|  | #  ''; | ||||||
|  | #  spotify = prev.spotify.overrideAttrs (something: rec { | ||||||
|  | #    installPhase = '' | ||||||
|  | #      echo no | ||||||
|  | #    ''; | ||||||
|  | 
 | ||||||
|  | #    desktopItem = something.desktopItem.override (desktop: { | ||||||
|  | #      exec = "LD_PRELOAD=/usr/local/lib/spotify-adblock.so ${desktop.exec}"; | ||||||
|  | #    }); | ||||||
|  | # | ||||||
|  | #    installPhase = builtins.replaceString [ | ||||||
|  | #      "${something.desktopItem}" | ||||||
|  | #    ] [ | ||||||
|  | #      "${desktopItem}" | ||||||
|  | #    ] something.installPhase; | ||||||
|  | #  }); | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue