nixos/home/david/modules/programs/zed.nix

128 lines
2.6 KiB
Nix
Raw Normal View History

2025-02-14 22:57:48 +08:00
{
pkgs,
config,
lib,
...
2025-07-13 06:04:55 +08:00
}:
let
2025-07-01 23:17:40 +08:00
cfg = config.david.programs.zed-editor;
2025-07-13 06:04:55 +08:00
in
{
2025-02-14 22:57:48 +08:00
options = {
2025-07-01 23:17:40 +08:00
david.programs.zed-editor = {
2025-02-14 22:57:48 +08:00
enable = lib.mkEnableOption "zed-editor";
};
};
config = lib.mkIf cfg.enable {
2025-04-10 20:28:50 +08:00
stylix.targets.zed.enable = false;
2025-02-14 22:57:48 +08:00
programs.zed-editor = {
enable = true;
extensions = [
2025-10-18 23:10:53 +08:00
"catppuccin"
2025-04-30 13:15:56 +08:00
"asciidoc"
"basher"
"cargo-tom"
"deno"
"docker-compose"
"dockerfile"
"fish"
"git-firefly"
"golangci-lint"
"haskell"
2025-04-29 00:39:36 +08:00
"html"
2025-04-30 13:15:56 +08:00
"hurl"
"idris2"
2025-04-29 00:39:36 +08:00
"java"
2025-04-30 13:15:56 +08:00
"java-eclipse-jdtls"
"kdl"
"kotlin"
"lua"
2025-04-29 00:39:36 +08:00
"make"
"markdown-oxide"
2025-04-30 13:15:56 +08:00
"neocmake"
"nix"
"python-refactoring"
"python-requirements"
"scheme"
"toml"
"typst"
"xml"
"zig"
2025-06-14 01:22:51 +08:00
"typos"
"ty"
"ruff"
2025-10-04 11:28:55 +08:00
"just"
"just-ls"
2025-10-18 23:10:53 +08:00
"jj-lsp"
"org"
2025-02-14 22:57:48 +08:00
];
extraPackages = with pkgs; [
editor-runtime
2025-02-14 22:57:48 +08:00
];
userSettings = {
lsp = {
ty = {
binary = {
path = lib.getExe pkgs.ty;
2025-07-13 06:04:55 +08:00
arguments = [ "server" ];
};
};
};
2025-04-30 13:15:56 +08:00
languages = {
Python = {
2025-07-13 06:04:55 +08:00
language_servers = [
"ty"
"ruff"
"pyright"
];
formatter = [
{
language_server = {
name = "ruff";
};
}
{
code_actions = {
"source.fixAll.ruff" = true;
"source.organizeImports.ruff" = true;
};
}
];
};
2025-04-30 13:15:56 +08:00
Nix = {
2025-07-13 06:04:55 +08:00
language_servers = [
"nixd"
"nil"
];
2025-04-30 13:15:56 +08:00
formatter = {
external = {
2025-07-13 06:04:55 +08:00
command = "nixfmt";
2025-04-30 13:15:56 +08:00
};
};
};
};
2025-04-29 00:39:36 +08:00
soft_wrap = "editor_width";
2025-04-10 20:28:50 +08:00
autosave = "on_focus_change";
auto_update = false;
2025-04-29 00:39:36 +08:00
calls = {
mute_on_join = true;
share_on_join = false;
};
2025-04-10 20:28:50 +08:00
"format_on_save" = "off";
ui_font_size = 20;
buffer_font_size = 20;
buffer_font_family = "Maple Mono NF CN";
buffer_font_features = {
"calt" = true;
"zero" = true;
"cv03" = true;
"ss08" = true;
};
2025-07-12 20:17:40 +08:00
ui_font_family = "Source Han Sans";
2025-10-18 23:10:53 +08:00
theme = "Catppuccin Latte";
helix_mode = true;
2025-02-14 22:57:48 +08:00
};
};
};
}