From ff4128f8ea57879050145cf077a27b9d3a9cbf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Mon, 19 Aug 2024 06:26:08 +0000 Subject: [PATCH] feat(home-manager): add support for spotify-player (#296) * feat(home-manager): add support for spotify-player * fix: make use of `inherit` Co-authored-by: seth * feat(spotify-player): enable in tests * chore: update spotify-player input --------- Co-authored-by: seth --- .sources/sources.json | 12 ++++++++++++ modules/home-manager/all-modules.nix | 1 + modules/home-manager/spotify-player.nix | 16 ++++++++++++++++ tests/home.nix | 1 + 4 files changed, 30 insertions(+) create mode 100644 modules/home-manager/spotify-player.nix diff --git a/.sources/sources.json b/.sources/sources.json index 0b3ecf0c..733921cd 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -360,6 +360,18 @@ "url": "https://github.com/catppuccin/skim/archive/d39304b5f84721788b19bc40aebcfd7720208d8a.tar.gz", "hash": "1b6cd1wfkprrn7imgf1w1f9a6iqy3bql2ansy7l0k44ps1gwrvxq" }, + "spotify-player": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "catppuccin", + "repo": "spotify-player" + }, + "branch": "main", + "revision": "34b3d23806770185b72466d777853c73454b85a6", + "url": "https://github.com/catppuccin/spotify-player/archive/34b3d23806770185b72466d777853c73454b85a6.tar.gz", + "hash": "15cz4x432681zwik8dwmjljj628v540c1fz1m4v6nvvw63bdzsbr" + }, "starship": { "type": "Git", "repository": { diff --git a/modules/home-manager/all-modules.nix b/modules/home-manager/all-modules.nix index 32d8a3db..0d30f02b 100644 --- a/modules/home-manager/all-modules.nix +++ b/modules/home-manager/all-modules.nix @@ -33,6 +33,7 @@ ./rio.nix ./rofi.nix ./skim.nix + ./spotify-player.nix ./starship.nix ./swaylock.nix ./sway.nix diff --git a/modules/home-manager/spotify-player.nix b/modules/home-manager/spotify-player.nix new file mode 100644 index 00000000..1a325ba0 --- /dev/null +++ b/modules/home-manager/spotify-player.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: +let + inherit (config.catppuccin) sources; + cfg = config.programs.spotify-player.catppuccin; + enable = cfg.enable && config.programs.spotify-player.enable; +in +{ + options.programs.spotify-player.catppuccin = lib.ctp.mkCatppuccinOpt { name = "spotify-player"; }; + + config = lib.mkIf enable { + programs.spotify-player = { + settings.theme = "Catppuccin-${cfg.flavor}"; + inherit (lib.importTOML "${sources.spotify-player}/theme.toml") themes; + }; + }; +} diff --git a/tests/home.nix b/tests/home.nix index 011b715c..004ceced 100644 --- a/tests/home.nix +++ b/tests/home.nix @@ -47,6 +47,7 @@ rio.enable = true; rofi.enable = true; skim.enable = true; + spotify-player.enable = true; starship.enable = true; swaylock.enable = true; tmux.enable = true;