137 lines
3.2 KiB
Nix
137 lines
3.2 KiB
Nix
{ pkgs, inputs, ... }:
|
|
|
|
let
|
|
system = pkgs.stdenv.hostPlatform.system;
|
|
nvchad = inputs.nix4nvchad.packages.${system}.default.override {
|
|
extraConfig = ''
|
|
local map = vim.keymap.set
|
|
local builtin = require('telescope.builtin')
|
|
|
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
|
map("n", "<leader>sw", "<cmd> set wrap! <CR>", {desc = "Toggle text wrapping"})
|
|
map("n", "<leader>fm", function() require("conform").format() end, {desc = "Format with conform"})
|
|
map("n", "<leader>-", "<cmd> Oil <CR>", {desc = "Open directory in oil"})
|
|
map("n", "<leader>rcu", function() require('crates').upgrade_all_crates() end, {desc = "Upgrade rust crates"})
|
|
map("n", "<leader>ca", function() vim.lsp.buf.code_action() end, {desc = "Lsp code action"})
|
|
map("n", "<leader>gr", function() vim.lsp.buf.references() end, {desc = "Lsp references"})
|
|
map("n", "<leader>gm", "<cmd>Telescope git_commits<CR>", { desc = "telescope git commits" })
|
|
|
|
map('n', '<leader>fi', function()
|
|
builtin.live_grep({
|
|
prompt_title = "Files matching TODO",
|
|
default_text = "(TODO|todo|FIXME|THOUGHT|REFACTOR|TEST)",
|
|
})
|
|
end, {desc = "find comments using telescope"})
|
|
|
|
-- stay in v mode after indenting
|
|
map("v", "<", "<gv")
|
|
map("v", ">", ">gv")
|
|
'';
|
|
|
|
extraPlugins = ''
|
|
return {
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
config = function()
|
|
require "configs.lspconfig"
|
|
end,
|
|
},{
|
|
"rcarriga/nvim-notify",
|
|
event = "VeryLazy",
|
|
config = function()
|
|
local notify = require "notify"
|
|
notify.setup {
|
|
background_colour = "#2D3540",
|
|
}
|
|
vim.notify = notify
|
|
end,
|
|
},{
|
|
"stevearc/oil.nvim",
|
|
opts = {},
|
|
dependencies = { "nvim-tree/nvim-web-devicons"},
|
|
lazy = false
|
|
},{
|
|
'saecki/crates.nvim',
|
|
event = { "BufRead Cargo.toml" },
|
|
config = function()
|
|
require('crates').setup()
|
|
end,
|
|
},{
|
|
"jglasovic/venv-lsp.nvim",
|
|
config = function()
|
|
require("venv-lsp").setup()
|
|
end,
|
|
lazy = false,
|
|
}
|
|
}
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
programs.java.enable = true;
|
|
programs.nix-ld.libraries = with pkgs; [
|
|
stdenv.cc.cc.lib
|
|
zlib
|
|
ncurses5
|
|
libGL
|
|
libGLU
|
|
vulkan-loader
|
|
libdrm
|
|
mesa
|
|
libx11
|
|
libxcursor
|
|
libxrandr
|
|
libxi
|
|
libxext
|
|
libxfixes
|
|
libxcb
|
|
wayland
|
|
libpulseaudio
|
|
alsa-lib
|
|
nss
|
|
nspr
|
|
expat
|
|
glib
|
|
dbus
|
|
systemd
|
|
freetype
|
|
fontconfig
|
|
];
|
|
|
|
users.users.djai.packages = with pkgs; [
|
|
# dev environment
|
|
godot
|
|
nvchad
|
|
jq
|
|
lazygit
|
|
ripgrep
|
|
|
|
# toolchains
|
|
cargo
|
|
gcc
|
|
gnumake
|
|
openssl
|
|
python3
|
|
rustc
|
|
uv
|
|
|
|
# containers / secrets
|
|
age
|
|
fluxcd
|
|
k9s
|
|
kubectl
|
|
kubectx
|
|
sops
|
|
|
|
# hosts / networks
|
|
wireguard-tools
|
|
lm_sensors
|
|
|
|
];
|
|
|
|
# TODO: switch to home manager
|
|
# FIXME: use builtins.readfile to store these config options i think
|
|
# home-manager.users.djai.home.packages = with pkgs; [];
|
|
|
|
}
|