80 lines
1.9 KiB
Nix
80 lines
1.9 KiB
Nix
{ user, home }:
|
|
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
hmConfig = config.home-manager.users.${user};
|
|
in
|
|
{
|
|
networking.firewall = {
|
|
allowedTCPPorts = [ 57621 ];
|
|
allowedUDPPorts = [ 5353 ];
|
|
};
|
|
|
|
environment.persistence = {
|
|
"/persist/state"."${home}/.config/spotify" = { };
|
|
"/persist/cache"."${home}/.cache/spotify" = { };
|
|
};
|
|
|
|
home-manager.users.${user} = {
|
|
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
|
|
|
programs.spicetify =
|
|
let
|
|
spicePkgs = inputs.spicetify-nix.legacyPackages.${system};
|
|
in
|
|
{
|
|
enable = true;
|
|
|
|
theme = spicePkgs.themes.sleek // {
|
|
extraCommands = ''
|
|
export COLORS_CSS_PATH="${home}/.config/spotify/theme.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 = "${inputs.secrets}/domains/personal/secrets.yaml";
|
|
|
|
xdg.configFile = {
|
|
"spotify/prefs.init" = {
|
|
source = ./config/prefs;
|
|
onChange = ''
|
|
${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}")
|
|
${lib.runtime.merge.keyValue} "${home}/.config/spotify/prefs-user.init" "${home}/.config/spotify/Users/''${user}-user/prefs"
|
|
'';
|
|
};
|
|
};
|
|
|
|
theme.template.".config/spotify/theme.css".source = ./theme.css;
|
|
};
|
|
}
|