diff --git a/flake.lock b/flake.lock index 103a45125..d5eb00c3c 100644 --- a/flake.lock +++ b/flake.lock @@ -185,7 +185,8 @@ "systems": "systems", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", - "tinted-tmux": "tinted-tmux" + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" } }, "systems": { @@ -252,6 +253,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 54902c0d3..12703a970 100644 --- a/flake.nix +++ b/flake.nix @@ -60,6 +60,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 000000000..b2aad1646 --- /dev/null +++ b/modules/zed/hm.nix @@ -0,0 +1,24 @@ +{ + 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 = { + "theme" = "Base16 ${config.lib.stylix.colors.scheme-name}"; + + "ui_font_family" = config.stylix.fonts.sansSerif.name; + "ui_font_size" = config.stylix.fonts.sizes.applications; + "buffer_font_family" = config.stylix.fonts.monospace.name; + "buffer_font_size" = config.stylix.fonts.sizes.terminal; + }; + + xdg.configFile."zed/themes/nix.json".source = theme; + }; +} diff --git a/stylix/templates.nix b/stylix/templates.nix index a3457d0de..662cc6ebf 100644 --- a/stylix/templates.nix +++ b/stylix/templates.nix @@ -9,6 +9,7 @@ inputs: tinted-foot tinted-kitty tinted-tmux + tinted-zed ; }; }