fix: some nix eval warnings
All checks were successful
Update Nix Packages with nix-update / nix-update (push) Successful in 46m52s
All checks were successful
Update Nix Packages with nix-update / nix-update (push) Successful in 46m52s
This commit is contained in:
@@ -1,80 +1,86 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.coding.editors;
|
||||
# home-manager 26.05+ renamed extraLuaConfig → initLua.
|
||||
# On stable 25.11 initLua does not exist; fall back to extraLuaConfig.
|
||||
hasInitLua = options.programs.neovim ? initLua;
|
||||
lazyVimConfig = ''
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
-- Bootstrap LazyVim via lazy.nvim
|
||||
-- Docs: https://github.com/folke/lazy.nvim and https://www.lazyvim.org/
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nix" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nushell" },
|
||||
{ "Mofiqul/dracula.nvim" },
|
||||
},
|
||||
defaults = { lazy = false, version = false },
|
||||
install = { colorscheme = { "dracula", "tokyonight", "habamax" } },
|
||||
checker = { enabled = false },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip", "tarPlugin", "tohtml", "tutor", "zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme("dracula")
|
||||
'';
|
||||
in {
|
||||
options.coding.editors = {
|
||||
neovim = {
|
||||
enable = mkEnableOption "neovim with LazyVim configuration";
|
||||
};
|
||||
|
||||
zed = {
|
||||
enable = mkEnableOption "zed editor with custom configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
# Neovim configuration
|
||||
(mkIf cfg.neovim.enable {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withNodeJs = true;
|
||||
withPython3 = true;
|
||||
|
||||
# This is your init.lua content (extraLuaConfig for compatibility with older home-manager)
|
||||
extraLuaConfig = ''
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Bootstrap LazyVim via lazy.nvim
|
||||
-- Docs: https://github.com/folke/lazy.nvim and https://www.lazyvim.org/
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nix" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nushell" },
|
||||
{ "Mofiqul/dracula.nvim" },
|
||||
},
|
||||
defaults = { lazy = false, version = false },
|
||||
install = { colorscheme = { "dracula", "tokyonight", "habamax" } },
|
||||
checker = { enabled = false },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip", "tarPlugin", "tohtml", "tutor", "zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme("dracula")
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.neovim.enable (mkMerge [
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withNodeJs = true;
|
||||
withPython3 = true;
|
||||
};
|
||||
}
|
||||
# Use initLua on HM 26.05+ (unstable), extraLuaConfig on HM ≤ 25.11 (stable)
|
||||
(
|
||||
if hasInitLua
|
||||
then {programs.neovim.initLua = lazyVimConfig;}
|
||||
else {programs.neovim.extraLuaConfig = lazyVimConfig;}
|
||||
)
|
||||
]))
|
||||
# Zed editor configuration
|
||||
(mkIf cfg.zed.enable {
|
||||
programs.zed-editor = {
|
||||
@@ -85,13 +91,11 @@ in {
|
||||
ui_font_size = 16;
|
||||
buffer_font_size = 16;
|
||||
buffer_font_family = "FiraCode Nerd Font";
|
||||
|
||||
# Editor Behavior
|
||||
vim_mode = true;
|
||||
auto_update = false;
|
||||
format_on_save = "on";
|
||||
load_direnv = "shell_hook";
|
||||
|
||||
# AI Features
|
||||
features = {
|
||||
edit_prediction_provider = "zed";
|
||||
@@ -100,14 +104,12 @@ in {
|
||||
mode = "subtle";
|
||||
};
|
||||
show_edit_predictions = true;
|
||||
|
||||
agent = {
|
||||
default_model = {
|
||||
provider = "zed.dev";
|
||||
model = "claude-sonnet-4";
|
||||
};
|
||||
};
|
||||
|
||||
assistant = {
|
||||
version = "2";
|
||||
default_model = {
|
||||
@@ -115,7 +117,6 @@ in {
|
||||
model = "claude-4";
|
||||
};
|
||||
};
|
||||
|
||||
# Language Models
|
||||
language_models = {
|
||||
anthropic = {
|
||||
@@ -128,7 +129,6 @@ in {
|
||||
api_url = "http://localhost:11434";
|
||||
};
|
||||
};
|
||||
|
||||
# Languages Configuration
|
||||
languages = {
|
||||
Nix = {
|
||||
@@ -153,7 +153,6 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# LSP Configuration
|
||||
lsp = {
|
||||
rust-analyzer = {
|
||||
@@ -169,7 +168,6 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Context Servers
|
||||
context_servers = {
|
||||
some-context-server = {
|
||||
@@ -182,7 +180,6 @@ in {
|
||||
env = {};
|
||||
};
|
||||
};
|
||||
|
||||
# Privacy
|
||||
telemetry = {
|
||||
metrics = false;
|
||||
@@ -190,7 +187,6 @@ in {
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
# Common packages (always installed if either editor is enabled)
|
||||
(mkIf (cfg.neovim.enable || cfg.zed.enable) {
|
||||
home.packages = with pkgs; [zig];
|
||||
|
||||
Reference in New Issue
Block a user