{ user, home }: { config, inputs, lib, system, ... }: let hmConfig = config.home-manager.users.${user}; in { nixpkgs.overlays = [ (final: prev: { spicetify-cli = prev.spicetify-cli.overrideAttrs (oldAttrs: { patches = oldAttrs.patches or [ ] ++ [ ./user-colors.patch ]; }); }) ]; 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 = '' ${ inputs.lib.lib.${system}.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}") ${ inputs.lib.lib.${system}.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; }; }