From 48ac6bc7f63374cb7e76da5ef7fb9081d2de2915 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 20 Oct 2024 15:26:56 -0700 Subject: [PATCH] feat(zellij): Catppuccin -> Rose Pine --- .sources/sources.json | 12 ++++++++++++ modules/home-manager/zellij.nix | 25 ++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.sources/sources.json b/.sources/sources.json index 2b53445..19808ca 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -372,6 +372,18 @@ "url": "https://github.com/edunfelt/zathura/archive/d72c431f8207a1f63c138d9bc64d689947c55e8e.tar.gz", "hash": "07b5pqdpd0qnhc223gmgw0nxy0wjbrkw6a36jdd03lyxvvhhx86r" }, + "zellij": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "rose-pine", + "repo": "zellij" + }, + "branch": "main", + "revision": "53835422f965e6c88b9ad59e11d343ca4552bf6d", + "url": "https://github.com/rose-pine/zellij/archive/53835422f965e6c88b9ad59e11d343ca4552bf6d.tar.gz", + "hash": "0cj31kv7y05cyyg7v0pc1dh5a2mp46sql2ngxk52cbks1garvnjl" + }, "zsh-syntax-highlighting": { "type": "Git", "repository": { diff --git a/modules/home-manager/zellij.nix b/modules/home-manager/zellij.nix index 7d2e5d2..4b5ac5f 100644 --- a/modules/home-manager/zellij.nix +++ b/modules/home-manager/zellij.nix @@ -1,13 +1,24 @@ -{ config, lib, ... }: -let - cfg = config.programs.zellij.catppuccin; - enable = cfg.enable && config.programs.zellij.enable; - themeName = "catppuccin-${cfg.flavor}"; -in { - options.programs.zellij.catppuccin = lib.ctp.mkCatppuccinOpt { name = "zellij"; }; + config, + lib, + ... +}: let + inherit (config.rose-pine) sources; + + cfg = config.programs.zellij.rose-pine; + enable = cfg.enable && config.programs.zellij.enable; + + themeName = + if (cfg.flavor == "main") + then "rose-pine" + else "rose-pine-${cfg.flavor}"; + theme = sources.zellij + "/dist/${themeName}.kdl"; +in { + options.programs.zellij.rose-pine = lib.rp.mkRosePineOpt {name = "zellij";}; config = lib.mkIf enable { + xdg.configFile."zellij/themes/${themeName}.kdl".source = theme; + programs.zellij.settings = { theme = themeName; };