From ae74f20cc25a24b9440b2ef9b95e6eb71a79186d Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Mon, 21 Apr 2025 13:28:41 -0700 Subject: [PATCH] zed: use themes option (#1151) Use the programs.zed-editor.themes option, introduced in commit [1] ("zed-editor: add themes option (#6832)"). [1]: https://github.com/nix-community/home-manager/commit/bb8d286649e97b89ad7dedae90418ff78f028c9d Link: https://github.com/danth/stylix/pull/1151 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- flake.lock | 6 +++--- modules/zed/hm.nix | 28 +++++++++++++++------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index 844172a0..349a3b33 100644 --- a/flake.lock +++ b/flake.lock @@ -224,11 +224,11 @@ ] }, "locked": { - "lastModified": 1744637364, - "narHash": "sha256-ZVINTNMJS6W3fqPYV549DSmjYQW5I9ceKBl83FwPP7k=", + "lastModified": 1745198506, + "narHash": "sha256-0hVbHuqAnZUnnGaBTqNes0P0kfH+KKyup2boWDST0iI=", "owner": "nix-community", "repo": "home-manager", - "rev": "337541447773985f825512afd0f9821a975186be", + "rev": "b0cc092405da805da6fa964f5a178343658ceaf0", "type": "github" }, "original": { diff --git a/modules/zed/hm.nix b/modules/zed/hm.nix index f102b8f3..fd60340c 100644 --- a/modules/zed/hm.nix +++ b/modules/zed/hm.nix @@ -14,20 +14,22 @@ && config.programs.zed-editor.enable ) { - programs.zed-editor.userSettings = - let - inherit (config.stylix) fonts; - in - { - "buffer_font_family" = fonts.monospace.name; - "buffer_font_size" = fonts.sizes.terminal * 4.0 / 3.0; - "theme" = "Base16 ${config.lib.stylix.colors.scheme-name}"; - "ui_font_family" = fonts.sansSerif.name; - "ui_font_size" = fonts.sizes.applications * 4.0 / 3.0; - }; + programs.zed-editor = { + userSettings = + let + inherit (config.stylix) fonts; + in + { + "buffer_font_family" = fonts.monospace.name; + "buffer_font_size" = fonts.sizes.terminal * 4.0 / 3.0; + "theme" = "Base16 ${config.lib.stylix.colors.scheme-name}"; + "ui_font_family" = fonts.sansSerif.name; + "ui_font_size" = fonts.sizes.applications * 4.0 / 3.0; + }; - xdg.configFile."zed/themes/nix.json".source = config.lib.stylix.colors { - templateRepo = config.stylix.inputs.tinted-zed; + themes.stylix = config.lib.stylix.colors { + templateRepo = config.stylix.inputs.tinted-zed; + }; }; }; }