From 5b93568483e1dc020262f05d3d23ca29b297a144 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 20 Oct 2024 12:03:00 -0700 Subject: [PATCH] feat(polybar): Catppuccin -> Rose Pine --- .sources/sources.json | 10 +++++----- modules/home-manager/polybar.nix | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.sources/sources.json b/.sources/sources.json index 1748553..dafff99 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -232,13 +232,13 @@ "type": "Git", "repository": { "type": "GitHub", - "owner": "catppuccin", + "owner": "rose-pine", "repo": "polybar" }, "branch": "main", - "revision": "20054f39d3b77bd1afc765981a42c3467bf91204", - "url": "https://github.com/catppuccin/polybar/archive/20054f39d3b77bd1afc765981a42c3467bf91204.tar.gz", - "hash": "130szcc72vnsl0872qpiiqad1qcspmasana4p2g9v3jxgn03xi4c" + "revision": "2c94fbc4997915c1c877cecc9aaf5b63797f74a4", + "url": "https://github.com/rose-pine/polybar/archive/2c94fbc4997915c1c877cecc9aaf5b63797f74a4.tar.gz", + "hash": "10b09fypcp8bj92wwkc95w4nwk4rxh0an3v2hdp551f8lc7qz75j" }, "rio": { "type": "Git", @@ -422,4 +422,4 @@ } }, "version": 3 -} +} \ No newline at end of file diff --git a/modules/home-manager/polybar.nix b/modules/home-manager/polybar.nix index 3a6636b..5448943 100644 --- a/modules/home-manager/polybar.nix +++ b/modules/home-manager/polybar.nix @@ -1,13 +1,21 @@ -{ config, lib, ... }: -let - inherit (config.catppuccin) sources; - cfg = config.services.polybar.catppuccin; - enable = cfg.enable && config.services.polybar.enable; -in { - options.services.polybar.catppuccin = lib.ctp.mkCatppuccinOpt { name = "polybar"; }; + config, + lib, + ... +}: let + inherit (config.rose-pine) sources; + + cfg = config.services.polybar.rose-pine; + enable = cfg.enable && config.services.polybar.enable; + + themeName = + if (cfg.flavor == "main") + then "rose-pine" + else "rose-pine-${cfg.flavor}"; +in { + options.services.polybar.rose-pine = lib.rp.mkRosePineOpt {name = "polybar";}; config.services.polybar.extraConfig = lib.mkIf enable ( - builtins.readFile "${sources.polybar}/themes/${cfg.flavor}.ini" + builtins.readFile "${sources.polybar}/schemes/${themeName}.ini" ); }