nixcfg/homeManagerModules/apps/zed/default.nix

112 lines
2.7 KiB
Nix
Raw Normal View History

{
config,
2024-07-13 21:24:21 -04:00
lib,
pkgs,
...
}: let
cfg = config.ar.home;
in {
config = lib.mkIf cfg.apps.zed.enable {
2024-07-13 21:24:21 -04:00
home.packages = [
cfg.apps.zed.package
2024-07-13 21:24:21 -04:00
pkgs.nixd
];
xdg.configFile = {
"zed/keymap.json".text = let
defaults = [
{
"context" = "Workspace";
"bindings" = {
2024-08-04 16:35:05 -04:00
"alt-e" = "file_finder::Toggle";
"ctrl-p" = "command_palette::Toggle";
"ctrl-shift-p" = "file_finder::Toggle";
};
}
];
keymaps = defaults ++ cfg.apps.zed.keymaps;
in
lib.generators.toJSON {} keymaps;
2024-07-13 21:24:21 -04:00
"zed/settings.json".text = let
defaults = {
auto_install_extensions = {
adwaita-pastel = true;
basher = true;
docker-compose = true;
dockerfile = true;
git-firefly = true;
haskell = true;
html = true;
ini = true;
just = true;
log = true;
make = true;
nix = true;
ruby = true;
};
auto_update = false;
autosave.after_delay.milliseconds = 1000;
buffer_font_family = cfg.theme.monospaceFont.name;
buffer_font_size = cfg.theme.monospaceFont.size + 3;
current_line_highlight = "line";
2024-07-13 21:24:21 -04:00
indent_guides = {
enabled = true;
background_coloring = "disabled";
coloring = "indent_aware";
line_width = 1;
};
languages = {
Nix = {
formatter.external = {
command = lib.getExe pkgs.alejandra;
arguments = [];
};
2024-07-13 23:35:22 -04:00
tab_size = 2;
};
2024-07-13 21:24:21 -04:00
};
preferred_line_length = 80;
2024-08-04 10:47:03 -04:00
show_wrap_guides = true;
soft_wrap = "preferred_line_length";
2024-07-13 23:35:22 -04:00
tab_bar = {
2024-07-30 12:10:49 -04:00
show = true;
show_nav_history_buttons = false;
};
2024-07-13 23:35:22 -04:00
tabs = {
close_position = "right";
git_status = true;
};
2024-07-13 23:35:22 -04:00
telemetry = {
2024-07-30 12:08:27 -04:00
diagnostics = false;
metrics = false;
};
2024-07-13 21:24:21 -04:00
terminal.font_size = cfg.theme.monospaceFont.size + 3;
2024-07-13 23:35:22 -04:00
theme = {
dark = "Adwaita Pastel Dark";
light = "Adwaita Pastel Light";
mode = "system";
};
2024-07-13 21:24:21 -04:00
ui_font_family = cfg.theme.sansFont.name;
ui_font_size = cfg.theme.sansFont.size + 5;
2024-07-27 22:15:39 -04:00
use_autoclose = false;
vim_mode = false;
};
settings = defaults // cfg.apps.zed.settings;
in
lib.generators.toJSON {} settings;
};
};
}