radish: add zed
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
../custom-programs
|
||||
./neovim
|
||||
./dnote.nix
|
||||
../modules/zed
|
||||
inputs.hastebin.nixosModules.hm
|
||||
];
|
||||
|
||||
@@ -110,7 +111,7 @@
|
||||
enable = true;
|
||||
font = {
|
||||
name = "IosevkaTerm NFM";
|
||||
size = 12;
|
||||
size = 14;
|
||||
};
|
||||
shellIntegration.enableZshIntegration = true;
|
||||
themeFile = "Tomorrow_Night";
|
||||
@@ -207,9 +208,10 @@
|
||||
};
|
||||
os = {
|
||||
edit = "$EDITOR {{filename}}";
|
||||
editAtLine = "$EDITOR +{{line}} {{filename}}";
|
||||
editAtLineAndWait = "$EDITOR --remote-wait +{{line}} {{filename}}";
|
||||
editAtLine = "$EDITOR {{filename}}:{{line}}";
|
||||
editAtLineAndWait = "$EDITOR --wait {{filename}}:{{line}}";
|
||||
};
|
||||
promptToReturnFromSubprocess = false;
|
||||
customCommands = [
|
||||
{
|
||||
key = "<c-p>";
|
||||
@@ -299,6 +301,10 @@
|
||||
clipboard_command = "${pkgs.wl-copy-both}/bin/wl-copy";
|
||||
};
|
||||
};
|
||||
zed-editor = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
};
|
||||
|
||||
gnome = {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
defaultEditor = false;
|
||||
options = {
|
||||
number = true;
|
||||
expandtab = true;
|
||||
|
||||
164
home/modules/zed/default.nix
Normal file
164
home/modules/zed/default.nix
Normal file
@@ -0,0 +1,164 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.zed-editor;
|
||||
in
|
||||
{
|
||||
options.programs.zed-editor = {
|
||||
userTasks = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.attrs;
|
||||
default = [ ];
|
||||
};
|
||||
defaultEditor = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.zed-editor = {
|
||||
package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zed-editor;
|
||||
extensions = [
|
||||
"ruby"
|
||||
"crystal"
|
||||
"nix"
|
||||
"svelte"
|
||||
];
|
||||
userSettings = {
|
||||
node = {
|
||||
path = lib.getExe pkgs.nodejs;
|
||||
npm_path = lib.getExe' pkgs.nodejs "npm";
|
||||
};
|
||||
assistant = {
|
||||
enabled = true;
|
||||
version = "2";
|
||||
default = "zed.dev";
|
||||
default_model = {
|
||||
provider = "zed.dev";
|
||||
model = "claude-3-5-sonnet-latest";
|
||||
};
|
||||
};
|
||||
autoUpdate = false;
|
||||
telemetry = {
|
||||
diagnostics = false;
|
||||
metrics = false;
|
||||
};
|
||||
vim_mode = true;
|
||||
languages = {
|
||||
Ruby = {
|
||||
language_servers = [
|
||||
"ruby-lsp"
|
||||
"!rubocop"
|
||||
"!solargraph"
|
||||
];
|
||||
};
|
||||
Nix = {
|
||||
formatter.external = {
|
||||
command = lib.getExe pkgs.nixfmt-rfc-style;
|
||||
arguments = [ "-q" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
lsp = with pkgs; {
|
||||
nixd.binary.path = lib.getExe nixd;
|
||||
nil.binary.path = lib.getExe nil;
|
||||
ruby-lsp.binary.path = lib.getExe ruby-lsp;
|
||||
yaml-language-server.binary.path = lib.getExe yaml-language-server;
|
||||
json-language-server.binary = {
|
||||
path = lib.getExe nodePackages.vscode-json-languageserver;
|
||||
arguments = [ "--stdio" ];
|
||||
};
|
||||
package-version-server.binary.path =
|
||||
lib.getExe
|
||||
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.package-version-server;
|
||||
eslint.settings.onIgnoredFiles = "off";
|
||||
};
|
||||
load_direnv = "shell_hook";
|
||||
theme = {
|
||||
mode = "system";
|
||||
light = "One Light";
|
||||
dark = "One Dark";
|
||||
};
|
||||
terminal = {
|
||||
line_height = "standard";
|
||||
font_family = "IosevkaTerm Nerd Font";
|
||||
};
|
||||
show_edit_predictions = true;
|
||||
buffer_font_family = "Iosevka Nerd Font";
|
||||
buffer_font_size = 16;
|
||||
ui_font_size = 17;
|
||||
relative_line_numbers = true;
|
||||
};
|
||||
userKeymaps = [
|
||||
{
|
||||
context = "VimControl && !menu";
|
||||
bindings = {
|
||||
"space g" = [
|
||||
"task::Spawn"
|
||||
{
|
||||
task_name = "lazygit";
|
||||
reveal_target = "center";
|
||||
}
|
||||
];
|
||||
"space r" = "pane::DeploySearch";
|
||||
"space f" = [
|
||||
"file_finder::Toggle"
|
||||
{ separate_history = true; }
|
||||
];
|
||||
"space :" = "task::Spawn";
|
||||
"g R" = "editor::FindAllReferences";
|
||||
};
|
||||
}
|
||||
{
|
||||
context = "Dock || Pane || Editor";
|
||||
bindings = {
|
||||
"ctrl-h" = [
|
||||
"workspace::ActivatePaneInDirection"
|
||||
"Left"
|
||||
];
|
||||
"ctrl-j" = [
|
||||
"workspace::ActivatePaneInDirection"
|
||||
"Down"
|
||||
];
|
||||
"ctrl-k" = [
|
||||
"workspace::ActivatePaneInDirection"
|
||||
"Up"
|
||||
];
|
||||
"ctrl-l" = [
|
||||
"workspace::ActivatePaneInDirection"
|
||||
"Right"
|
||||
];
|
||||
};
|
||||
}
|
||||
{
|
||||
context = "Terminal";
|
||||
bindings = {
|
||||
"ctrl-p" = [
|
||||
"terminal::SendKeystroke"
|
||||
"ctrl-p"
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
userTasks = with pkgs; [
|
||||
{
|
||||
label = "lazygit";
|
||||
command = "${lib.getExe lazygit} -p $ZED_WORKTREE_ROOT";
|
||||
hide = "on_success";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile."zed/tasks.json".text = builtins.toJSON cfg.userTasks;
|
||||
|
||||
home.sessionVariables = lib.mkIf cfg.defaultEditor {
|
||||
EDITOR = lib.getExe pkgs.zed-editor;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user