mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
added spicetify configuration and home-manager changes
This commit is contained in:
parent
be44e60b8c
commit
30b43b8bc7
8 changed files with 141 additions and 20 deletions
21
flake.nix
21
flake.nix
|
|
@ -2,12 +2,16 @@
|
|||
description = "my personal configurations";
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager/master";
|
||||
home-manager.inputs.nixkpkgs.follows = "nixpkgs";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixkpkgs.follows = "nixpkgs";
|
||||
};
|
||||
spicetify-nix.url = "github:the-argus/spicetify-nix";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, home-manager, ... }:
|
||||
outputs = {self, nixpkgs, home-manager, spicetify-nix, ... }@inputs:
|
||||
let
|
||||
username = "gerg";
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
|
@ -31,13 +35,18 @@
|
|||
};
|
||||
lib = nixpkgs.lib;
|
||||
in {
|
||||
homeManagerConfiguration = {
|
||||
gerg = home-manager.lib.homeManagerConfiguration {
|
||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [
|
||||
./home-manager/home-manager.nix
|
||||
./home-manager/home.nix
|
||||
];
|
||||
extraSpecialArgs = { inherit spicetify-nix; };
|
||||
};
|
||||
homeConfigurations.root = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [
|
||||
./home-manager/root.nix
|
||||
];
|
||||
};
|
||||
nixosConfigurations = {
|
||||
gerg-laptop = lib.nixosSystem {
|
||||
|
|
|
|||
57
home-manager/config/spicetify/Extensions/adblock.js
Normal file
57
home-manager/config/spicetify/Extensions/adblock.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//@ts-check
|
||||
|
||||
// NAME: adblock
|
||||
// AUTHOR: CharlieS1103
|
||||
// DESCRIPTION: Block all audio and UI ads on Spotify
|
||||
|
||||
/// <reference path="../../spicetify-cli/globals.d.ts" />
|
||||
|
||||
(function adblock() {
|
||||
const { Platform} = Spicetify;
|
||||
if (!(Platform)) {
|
||||
setTimeout(adblock, 300)
|
||||
return
|
||||
}
|
||||
|
||||
var styleSheet = document.createElement("style")
|
||||
|
||||
styleSheet.innerHTML =
|
||||
`
|
||||
.MnW5SczTcbdFHxLZ_Z8j, .WiPggcPDzbwGxoxwLWFf, .ReyA3uE3K7oEz7PTTnAn, .main-leaderboardComponent-container, .sponsor-container, a.link-subtle.main-navBar-navBarLink.GKnnhbExo0U9l7Jz2rdc{
|
||||
display: none !important;
|
||||
}
|
||||
`
|
||||
document.body.appendChild(styleSheet)
|
||||
delayAds()
|
||||
var billboard = Spicetify.Platform.AdManagers.billboard.displayBillboard;
|
||||
Spicetify.Platform.AdManagers.billboard.displayBillboard = function (arguments) {
|
||||
Spicetify.Platform.AdManagers.billboard.finish()
|
||||
// hook before call
|
||||
var ret = billboard.apply(this, arguments);
|
||||
// hook after call
|
||||
console.log("Adblock.js: Billboard blocked! Leave a star!")
|
||||
Spicetify.Platform.AdManagers.billboard.finish()
|
||||
const observer = new MutationObserver((mutations, obs) => {
|
||||
const billboardAd = document.getElementById('view-billboard-ad');
|
||||
if (billboardAd) {
|
||||
Spicetify.Platform.AdManagers.billboard.finish()
|
||||
obs.disconnect();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
function delayAds() {
|
||||
console.log("Ads delayed: Adblock.js")
|
||||
Spicetify.Platform.AdManagers.audio.audioApi.cosmosConnector.increaseStreamTime(-100000000000)
|
||||
Spicetify.Platform.AdManagers.billboard.billboardApi.cosmosConnector.increaseStreamTime(-100000000000)
|
||||
}
|
||||
setInterval(delayAds, 720 *10000);
|
||||
|
||||
|
||||
})()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{config, pkgs, home-manager, ...}:
|
||||
{config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
./firefox.nix
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
./picom.nix
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
./spicetify.nix
|
||||
];
|
||||
xsession.numlock.enable = true;
|
||||
programs.home-manager.enable = true;
|
||||
25
home-manager/root.nix
Normal file
25
home-manager/root.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
./theme.nix
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
];
|
||||
xsession.numlock.enable = true;
|
||||
programs.home-manager.enable = true;
|
||||
home = {
|
||||
username = "root";
|
||||
homeDirectory = "/root";
|
||||
stateVersion = "22.11";
|
||||
file = {
|
||||
".config/Thunar" = {
|
||||
source = ./config/Thunar;
|
||||
recursive = true;
|
||||
};
|
||||
".config/neofetch/config.conf" = {
|
||||
source = ./config/neofetch/config.conf;
|
||||
recursive = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
35
home-manager/spicetify.nix
Normal file
35
home-manager/spicetify.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, lib, spicetify-nix, ... }:
|
||||
let
|
||||
spotifyNoPremiumSrc = pkgs.fetchgit {
|
||||
url = "https://github.com/Daksh777/SpotifyNoPremium";
|
||||
rev = "a2daa7a9ec3e21ebba3c6ab0ad1eb5bd8e51a3ca";
|
||||
sha256 = "1sr6pjaygxxx6majmk5zg8967jry53z6xd6zc31ns2g4r5sy4k8d";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ spicetify-nix.homeManagerModule ];
|
||||
programs.spicetify = {
|
||||
spotifyPackage = pkgs.spotify-unwrapped;
|
||||
spicetifyPackage = pkgs.spicetify-cli;
|
||||
enable = true;
|
||||
enabledExtensions = with spicetify-nix.pkgs.extensions; [
|
||||
"adblock.js"
|
||||
"hidePodcasts.js"
|
||||
];
|
||||
theme = {
|
||||
name = "spotifyNoPremium";
|
||||
src = spotifyNoPremiumSrc;
|
||||
appendName = false;
|
||||
injectCss = true;
|
||||
replaceColors = false;
|
||||
overwriteAssets = false;
|
||||
sidebarConfig = false;
|
||||
requiredExtensions = [
|
||||
{
|
||||
src = spotifyNoPremiumSrc;
|
||||
filename = "adblock.js";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -17,7 +17,6 @@ environment.systemPackages = with pkgs; [
|
|||
btrfs-progs #for external harddrive
|
||||
#user/gui
|
||||
discord
|
||||
spotify
|
||||
spotify-tray
|
||||
vlc
|
||||
bitwarden
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
{
|
||||
output = "HDMI-0";
|
||||
primary = true;
|
||||
monitorConfig = ''
|
||||
Option "DPMS" "false"
|
||||
'';
|
||||
}
|
||||
];
|
||||
screenSection = ''
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
update-system = pkgs.writeScriptBin "update-system" ''
|
||||
|
|
@ -16,14 +16,12 @@ let
|
|||
|
||||
apply-users = pkgs.writeScriptBin "apply-users" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
nix build /etc/nixos/#homeManagerConfiguration.gerg.activationPackage
|
||||
./result/activate
|
||||
rm -rf ./result
|
||||
home-manager switch --flake /etc/nixos/#$(whoami)
|
||||
'';
|
||||
|
||||
apply-system = pkgs.writeScriptBin "apply-system" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
nixos-rebuild switch --flake /etc/nixos/#
|
||||
nixos-rebuild switch --flake /etc/nixos/#${config.networking.hostName}
|
||||
'';
|
||||
|
||||
polybar-tray = pkgs.writeScriptBin "polybar-tray" ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue