Reorganize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
90
hosts/common/configs/user/gui/spicetify/default.nix
Normal file
90
hosts/common/configs/user/gui/spicetify/default.nix
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 57621 ];
|
||||
allowedUDPPorts = [ 5353 ];
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/spotify" = { };
|
||||
"/cache"."${home}/.cache/spotify" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
||||
|
||||
programs.spicetify =
|
||||
let
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
||||
spicetifyPackage = pkgs.spicetify-cli.overrideAttrs (oldAttrs: {
|
||||
patches = oldAttrs.patches or [ ] ++ [ ./user-colors.patch ];
|
||||
});
|
||||
|
||||
theme = spicePkgs.themes.sleek // {
|
||||
extraCommands = ''
|
||||
export COLORS_CSS_PATH="${home}/.config/spotify/colors.css"
|
||||
'';
|
||||
|
||||
additionalCss = ''
|
||||
.main-topBar-topbarContentRight button {
|
||||
background-color: unset !important;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
enabledExtensions = with spicePkgs.extensions; [
|
||||
loopyLoop
|
||||
trashbin
|
||||
fullAlbumDate
|
||||
phraseToPlaylist
|
||||
songStats
|
||||
copyToClipboard
|
||||
betterGenres
|
||||
adblock
|
||||
autoSkip
|
||||
];
|
||||
};
|
||||
|
||||
sops.secrets."spotify/username".sopsFile = ../../../../../../secrets/personal/secrets.yaml;
|
||||
|
||||
xdg.configFile = {
|
||||
"spotify/prefs.init" = {
|
||||
source = ./config/prefs;
|
||||
onChange = ''
|
||||
${config.lib.runtime.merge.keyValue} "${home}/.config/spotify/prefs.init" "${home}/.config/spotify/prefs"
|
||||
'';
|
||||
};
|
||||
|
||||
"spotify/prefs-user.init" = {
|
||||
source = ./config/prefs-user;
|
||||
onChange = ''
|
||||
user = $(cat "${hmConfig.sops.secrets."spotify/username".path}")
|
||||
${config.lib.runtime.merge.keyValue} "${home}/.config/spotify/prefs-user.init" "${home}/.config/spotify/Users/''${user}-user/prefs"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
theme.template."${home}/.config/spotify/colors.css".source = ./colors.css;
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod, m, exec, ${lib.meta.getExe hmConfig.programs.spicetify.spicedSpotify}"
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user