{ user ? throw "user argument is required", home ? throw "home argument is required", }: { config, inputs, lib, system, ... }: 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.${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 = ../../../../../../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/theme.css".source = ./theme.css; wayland.windowManager.hyprland.settings.bind = [ "$mod, s, exec, ${lib.meta.getExe hmConfig.programs.spicetify.spicedSpotify}" ]; }; }