From d4c3806c8f4e7c680cc8958e9299f3db300f3522 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 19 Oct 2024 23:39:46 -0700 Subject: [PATCH] feat(hyprland): Catppuccin -> Rose Pine --- .sources/sources.json | 8 +++---- modules/home-manager/hyprland.nix | 36 ++++++++++++++++--------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.sources/sources.json b/.sources/sources.json index acf2442..f8a0217 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -196,13 +196,13 @@ "type": "Git", "repository": { "type": "GitHub", - "owner": "catppuccin", + "owner": "rose-pine", "repo": "hyprland" }, "branch": "main", - "revision": "c388ac55563ddeea0afe9df79d4bfff0096b146b", - "url": "https://github.com/catppuccin/hyprland/archive/c388ac55563ddeea0afe9df79d4bfff0096b146b.tar.gz", - "hash": "0cxzxfgbqnkdnvn8nch4z4s7izzlm2jgciq1s8cjmypf8g7vy9n5" + "revision": "6898fe967c59f9bec614a9a58993e0cb8090d052", + "url": "https://github.com/rose-pine/hyprland/archive/6898fe967c59f9bec614a9a58993e0cb8090d052.tar.gz", + "hash": "1l9xrrympg8ikvmq8mazb9x2byci4l230hqgyagvl3id8xkiicm1" }, "imv": { "type": "Git", diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index fb3351f..ba88057 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -1,29 +1,31 @@ -{ config, lib, ... }: -let - inherit (config.catppuccin) sources pointerCursor; - cfg = config.wayland.windowManager.hyprland.catppuccin; - enable = cfg.enable && config.wayland.windowManager.hyprland.enable; -in { - options.wayland.windowManager.hyprland.catppuccin = - lib.ctp.mkCatppuccinOpt { name = "hyprland"; } + config, + lib, + ... +}: let + inherit (config.rose-pine) sources; + + cfg = config.wayland.windowManager.hyprland.rose-pine; + enable = cfg.enable && config.wayland.windowManager.hyprland.enable; + + themeName = + if (cfg.flavor == "main") + then "rose-pine" + else "rose-pine-${cfg.flavor}"; +in { + options.wayland.windowManager.hyprland.rose-pine = + lib.rp.mkRosePineOpt {name = "hyprland";} // { - accent = lib.ctp.mkAccentOpt "hyprland"; + accent = lib.rp.mkAccentOpt "hyprland"; }; config = lib.mkIf enable { - home.sessionVariables = lib.mkIf pointerCursor.enable { - HYPRCURSOR_SIZE = config.home.pointerCursor.size; - HYPRCURSOR_THEME = "catppuccin-${pointerCursor.flavor}-${pointerCursor.accent}-cursors"; - }; - wayland.windowManager.hyprland.settings = { source = [ - "${sources.hyprland}/themes/${cfg.flavor}.conf" - # Define accents in file to ensure they appear before user vars + "${sources.hyprland}/${themeName}.conf" + # Define accent in file to ensure it appears before user vars (builtins.toFile "hyprland-${cfg.accent}-accent.conf" '' $accent = ''$${cfg.accent} - $accentAlpha = ''$${cfg.accent}Alpha '') ]; };