From dede06da4c944232ba3f95710a26f298729532b9 Mon Sep 17 00:00:00 2001 From: Isabel Date: Fri, 20 Dec 2024 20:35:07 +0000 Subject: [PATCH] feat(home-manager): add support for zed-editor (#359) --- modules/home-manager/all-modules.nix | 1 + modules/home-manager/zed-editor.nix | 25 +++++++++++++++++++++++++ tests/home.nix | 1 + 3 files changed, 27 insertions(+) create mode 100644 modules/home-manager/zed-editor.nix diff --git a/modules/home-manager/all-modules.nix b/modules/home-manager/all-modules.nix index 99793ed7..a7cf5e4b 100644 --- a/modules/home-manager/all-modules.nix +++ b/modules/home-manager/all-modules.nix @@ -45,6 +45,7 @@ ./waybar.nix ./yazi.nix ./zathura.nix + ./zed-editor.nix ./zellij.nix ./zsh-syntax-highlighting.nix ] diff --git a/modules/home-manager/zed-editor.nix b/modules/home-manager/zed-editor.nix new file mode 100644 index 00000000..16f335d0 --- /dev/null +++ b/modules/home-manager/zed-editor.nix @@ -0,0 +1,25 @@ +{ catppuccinLib }: +{ config, lib, ... }: + +let + cfg = config.catppuccin.zed; +in + +{ + options.catppuccin.zed = catppuccinLib.mkCatppuccinOption { name = "zed"; } // { + italics = lib.mkEnableOption "the italicized version of theme" // { + default = true; + }; + }; + + config = lib.mkIf cfg.enable { + programs.zed-editor = { + extensions = [ "catppuccin" ]; + + userSettings.theme = { + light = "Catppuccin " + cfg.flavor + lib.optionalString cfg.italics " - No Italic"; + dark = "Catppuccin" + cfg.flavor + lib.optionalString cfg.italics " - No Italic"; + }; + }; + }; +} diff --git a/tests/home.nix b/tests/home.nix index dd4dd22f..c530453d 100644 --- a/tests/home.nix +++ b/tests/home.nix @@ -60,6 +60,7 @@ waybar.enable = true; yazi.enable = true; zathura.enable = true; + zed-editor.enable = true; zellij.enable = true; zsh = { enable = true;