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,7 +10,22 @@
pkgs.nixd pkgs.nixd
]; ];
xdg.configFile."zed/settings.json".text = let 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;
"zed/settings.json".text = let
defaults = { defaults = {
auto_install_extensions = { auto_install_extensions = {
adwaita-pastel = true; adwaita-pastel = true;
@ -84,4 +99,5 @@
in in
lib.generators.toJSON {} settings; lib.generators.toJSON {} settings;
}; };
};
} }

View file

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