From 8cb4d9b4c801d2f82d93f4961332d4d18582b1d1 Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:05:44 +0800 Subject: [PATCH] feat(modules/home-manager): add glamour --- modules/home-manager/default.nix | 1 + modules/home-manager/glamour.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 modules/home-manager/glamour.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index aedcb0bf..ee610e57 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -19,6 +19,7 @@ in ./lazygit.nix ./starship.nix ./helix.nix + ./glamour.nix ./gtk.nix ./neovim.nix ./polybar.nix diff --git a/modules/home-manager/glamour.nix b/modules/home-manager/glamour.nix new file mode 100644 index 00000000..d0bc7a49 --- /dev/null +++ b/modules/home-manager/glamour.nix @@ -0,0 +1,31 @@ +{ config +, pkgs +, lib +, +}: +let + cfg = config.programs.glamour.catppuccin; + enable = cfg.enable; + + version = "1.0.0"; + + hashes = { + latte = "sha256-V0LsRStF1vL+Tz8G6VaKiwiY/ZIsSkMc+f1WJAITYXU="; + frappe = "sha256-YOatgYCJKuesVERHZVmF1xtzuLjyxCYstoWYqATq+NU="; + macchiato = "sha256-CeSJvhjzHVTtlqgQLKOrdLXtp2OQlMh24IaA1QQiQCk="; + mocha = "sha256-Tx2fQteL4wxhV+qHYZibakiYoEhS4HjyMO0yBcU/F6Q="; + }; +in +{ + options.programs.glamour.catppuccin = + lib.ctp.mkCatppuccinOpt "glamour" config; + + config = { + home.sessionVariables = lib.mkIf enable { + GLAMOUR_STYLE = pkgs.fetchurl { + url = "https://github.com/catppuccin/glamour/releases/download/v${version}/${cfg.flavour}.json"; + hash = hashes.${cfg.flavour}; + }; + }; + }; +}