From b47ef3b8560c3921404d72cec95d84632e355e01 Mon Sep 17 00:00:00 2001 From: Floryan Simar Date: Mon, 6 Jan 2025 16:21:27 +0100 Subject: [PATCH] zed: init (#620) Closes: https://github.com/danth/stylix/issues/348 Link: https://github.com/danth/stylix/pull/620 Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- flake.lock | 19 ++++++++++++++++++- flake.nix | 5 +++++ modules/zed/hm.nix | 32 ++++++++++++++++++++++++++++++++ stylix/templates.nix | 1 + 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 modules/zed/hm.nix diff --git a/flake.lock b/flake.lock index 7486ec27..9b4ce516 100644 --- a/flake.lock +++ b/flake.lock @@ -235,7 +235,8 @@ "systems": "systems", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", - "tinted-tmux": "tinted-tmux" + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" } }, "systems": { @@ -302,6 +303,22 @@ "repo": "tinted-tmux", "type": "github" } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 379adc7f..b7bea456 100644 --- a/flake.nix +++ b/flake.nix @@ -70,6 +70,11 @@ url = "github:tinted-theming/tinted-foot/fd1b924b6c45c3e4465e8a849e67ea82933fcbe4"; }; + tinted-zed = { + flake = false; + url = "github:tinted-theming/base16-zed"; + }; + tinted-tmux = { flake = false; url = "github:tinted-theming/tinted-tmux"; diff --git a/modules/zed/hm.nix b/modules/zed/hm.nix new file mode 100644 index 00000000..0f13c673 --- /dev/null +++ b/modules/zed/hm.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: +let + theme = config.lib.stylix.colors { + templateRepo = config.lib.stylix.templates.tinted-zed; + }; +in +{ + options.stylix.targets.zed.enable = config.lib.stylix.mkEnableTarget "zed" true; + + config = + lib.mkIf + ( + config.stylix.enable + && config.stylix.targets.zed.enable + && config.programs.zed-editor.enable + ) + { + programs.zed-editor.userSettings = { + "buffer_font_family" = config.stylix.fonts.monospace.name; + "buffer_font_size" = config.stylix.fonts.sizes.terminal; + "theme" = "Base16 ${config.lib.stylix.colors.scheme-name}"; + "ui_font_family" = config.stylix.fonts.sansSerif.name; + "ui_font_size" = config.stylix.fonts.sizes.applications; + }; + + xdg.configFile."zed/themes/nix.json".source = theme; + }; +} diff --git a/stylix/templates.nix b/stylix/templates.nix index 7c779d4e..3b6d614e 100644 --- a/stylix/templates.nix +++ b/stylix/templates.nix @@ -8,6 +8,7 @@ inputs: { tinted-foot tinted-kitty tinted-tmux + tinted-zed ; }; }