home/zed: add keymaps options with default additions (#32)

This commit is contained in:
Aly Raffauf 2024-07-15 15:45:02 -04:00 committed by GitHub
parent cb4d214916
commit 2f0b5cab25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 91 additions and 69 deletions

View file

@ -10,78 +10,94 @@
pkgs.nixd
];
xdg.configFile."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 = "NotoSansM Nerd Font";
buffer_font_size = 14;
current_line_highlight = "line";
indent_guides = {
enabled = true;
background_coloring = "disabled";
coloring = "indent_aware";
line_width = 1;
};
languages = {
Nix = {
formatter.external = {
command = lib.getExe pkgs.alejandra;
arguments = [];
xdg.configFile = {
"zed/keymap.json".text = let
defaults = [
{
"context" = "Workspace";
"bindings" = {
"ctrl-p" = "command_palette::Toggle";
"ctrl-shift-p" = "file_finder::Toggle";
};
}
];
keymaps = defaults ++ config.ar.home.apps.zed.keymaps;
in
lib.generators.toJSON {} keymaps;
tab_size = 2;
"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 = "NotoSansM Nerd Font";
buffer_font_size = 14;
current_line_highlight = "line";
indent_guides = {
enabled = true;
background_coloring = "disabled";
coloring = "indent_aware";
line_width = 1;
};
languages = {
Nix = {
formatter.external = {
command = lib.getExe pkgs.alejandra;
arguments = [];
};
tab_size = 2;
};
};
preferred_line_length = 80;
tab_bar = {
show = false;
show_nav_history_buttons = false;
};
tabs = {
close_position = "right";
git_status = true;
};
telemetry = {
diagnostics = true;
metrics = true;
};
terminal.font_size = 12;
theme = {
dark = "Adwaita Pastel Dark";
light = "Adwaita Pastel Light";
mode = "system";
};
ui_font_size = 16;
vim_mode = false;
};
preferred_line_length = 80;
tab_bar = {
show = false;
show_nav_history_buttons = false;
};
tabs = {
close_position = "right";
git_status = true;
};
telemetry = {
diagnostics = true;
metrics = true;
};
terminal.font_size = 12;
theme = {
dark = "Adwaita Pastel Dark";
light = "Adwaita Pastel Light";
mode = "system";
};
ui_font_size = 16;
vim_mode = false;
};
settings = defaults // config.ar.home.apps.zed.settings;
in
lib.generators.toJSON {} settings;
settings = defaults // config.ar.home.apps.zed.settings;
in
lib.generators.toJSON {} settings;
};
};
}

View file

@ -57,6 +57,12 @@ in {
enable = lib.mkEnableOption "Zed text editor.";
package = lib.mkPackageOption pkgs "zed-editor" {};
keymaps = lib.mkOption {
description = "Zed keymaps.";
default = [];
type = lib.types.listOf lib.types.attrs;
};
settings = lib.mkOption {
description = "Zed settings.";
default = {};