{ inputs, self, ... }: { flake.nixosModules.graphics = { pkgs, config, lib, ... }: let spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}; theme-option-type = with inputs.nixpkgs; lib.types.enum (builtins.attrNames spicePkgs.themes); in { options.features.applications.gui.spotify = { enable = lib.mkEnableOption "spotify"; spicetify = { enable = lib.mkEnableOption "spicetify"; theme = lib.mkOption { type = lib.types.nullOr (theme-option-type); default = null; }; }; }; config = lib.mkIf (config.features.applications.gui.spotify.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) { home-manager.users.grey.features.applications.gui.spotify = { enable = lib.mkDefault true; spicetify = lib.mkDefault config.features.applications.gui.spotify.spicetify; }; } { environment.systemPackages = [ pkgs.spotify ]; }); }; flake.homeModules.graphics = { pkgs, config, lib, ... }: let spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}; theme-option-type = with inputs.nixpkgs; lib.types.enum (builtins.attrNames spicePkgs.themes); in { options.features.applications.gui.spotify = { enable = lib.mkEnableOption "spotify"; spicetify = { enable = lib.mkEnableOption "spicetify"; theme = lib.mkOption { type = lib.types.nullOr (theme-option-type); default = null; }; }; }; imports = [ inputs.spicetify.homeManagerModules.default ]; config = lib.mkIf (config.features.applications.gui.spotify.enable) { home.packages = lib.mkIf (!config.features.applications.gui.spotify.spicetify.enable) [ pkgs.spotify ]; programs.spicetify = lib.mkIf (config.features.applications.gui.spotify.spicetify.enable) { enable = true; enabledExtensions = with spicePkgs.extensions; [ # hidePodcasts ]; enabledSnippets = with spicePkgs.snippets; [ spinningCdCoverArt oneko hideMiniPlayerButton hideFullScreenButton declutterNowPlayingBar modernScrollbar ]; enabledCustomApps = with spicePkgs.apps; [ # marketplace ]; theme = lib.mkIf (config.features.applications.gui.spotify.spicetify.theme != null) spicePkgs.themes.${config.features.applications.gui.spotify.spicetify.theme}; windowManagerPatch = true; }; }; }; }