From 516b1b2a38732625bd5a3935b75482bcd5911b12 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Fri, 18 Jul 2025 16:19:56 +0300 Subject: [PATCH] feat: enable spicetify --- flake.lock | 45 ++++++++++++++++++++++++--- flake.nix | 4 +++ modules/home/applications/spotify.nix | 33 +++++++++++++++++--- 3 files changed, 74 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 8a50555..720f9bc 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1751641756, - "narHash": "sha256-5fXKpa5iVpsnsHUhiqMQ1gXdOGwEKc61fXhaMZn7Gb4=", + "lastModified": 1752784378, + "narHash": "sha256-/SCDPErJkEuKEdZjj9wwyq4otLeyGMU4pe51saRABno=", "owner": "AtaraxiaSjel", "repo": "nur", - "rev": "73e0fbc32ab305d50b84ab351c31604f003b50a8", + "rev": "b8efe256d1eba2247ef98b1cc49cf0bab32531d7", "type": "github" }, "original": { @@ -1077,6 +1077,7 @@ "nixpkgs-unstable": "nixpkgs-unstable", "quadlet-nix": "quadlet-nix", "sops-nix": "sops-nix", + "spicetify-nix": "spicetify-nix", "srvos": "srvos", "walker": "walker" } @@ -1122,6 +1123,27 @@ "type": "github" } }, + "spicetify-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1752381641, + "narHash": "sha256-R2iDZb94RosuCeuIukacZVVXxzWYr4jn/QI/ax15nW8=", + "owner": "Gerg-L", + "repo": "spicetify-nix", + "rev": "8f9fd947c52aa6adb6bafe72516eccf186708954", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "spicetify-nix", + "type": "github" + } + }, "srvos": { "inputs": { "nixpkgs": [ @@ -1188,6 +1210,21 @@ } }, "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1225,7 +1262,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1752655476, diff --git a/flake.nix b/flake.nix index b3a8fe3..ee785d0 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,10 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; srvos = { url = "github:nix-community/srvos"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/home/applications/spotify.nix b/modules/home/applications/spotify.nix index c6330a1..6f5d4fc 100644 --- a/modules/home/applications/spotify.nix +++ b/modules/home/applications/spotify.nix @@ -2,24 +2,49 @@ config, lib, pkgs, + inputs, ... }: let - inherit (lib) getExe mkEnableOption mkIf; + inherit (lib) mkEnableOption mkIf; cfg = config.ataraxia.programs.spotify; + + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.hostPlatform.system}; in { + imports = [ inputs.spicetify-nix.homeManagerModules.default ]; + options.ataraxia.programs.spotify = { enable = mkEnableOption "Enable spotify program"; + spicetify = mkEnableOption "Enable spicetify module" // { + default = true; + }; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - spotifywm + programs.spicetify = mkIf cfg.spicetify { + enable = true; + experimentalFeatures = true; + enabledExtensions = with spicePkgs.extensions; [ + adblockify + hidePodcasts + shuffle + ]; + theme = spicePkgs.themes.catppuccin; + colorScheme = if config ? catppuccin then config.catppuccin.flavor else "mocha"; + windowManagerPatch = true; + }; + + home.packages = mkIf (!cfg.spicetify) [ + pkgs.spotifywm ]; defaultApplications.spotify = { - cmd = getExe pkgs.spotifywm; + cmd = + if cfg.spicetify then + "${config.programs.spicetify.spicedSpotify}/bin/spotify" + else + "${pkgs.spotifywm}/bin/spotify"; desktop = "spotify"; };