initial commit

This commit is contained in:
ZotyDev 2026-02-22 13:49:58 -03:00
commit 179e92ee04
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
17 changed files with 2377 additions and 0 deletions

19
.direnv/bin/nix-direnv-reload Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/zoty/.config/nvim" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/zoty/.config/nvim")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/zoty/.config/nvim" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/zoty/.config/nvim/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/zoty/.config/nvim/.envrc" "/home/zoty/.config/nvim/.direnv"/*.rc

View file

@ -0,0 +1 @@
/nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source

View file

@ -0,0 +1 @@
/nix/store/dx2qikyb4dyb6hbdfywbmsyla0z5a1h3-source

View file

@ -0,0 +1 @@
/nix/store/nwcdjn11dysa7jsi8figcgcgp6xz6vlr-source

View file

@ -0,0 +1 @@
/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source

View file

@ -0,0 +1 @@
/nix/store/zr45c7jc8w9k22sdj2nnaadbc2ahlyrd-nix-shell-env

File diff suppressed because it is too large Load diff

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771369470,
"narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0182a361324364ae3f436a63005877674cf45efb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

24
flake.nix Normal file
View file

@ -0,0 +1,24 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
neovim
# LSPs
lua-language-server
nixd
rust-analyzer
];
};
}
);
}

19
init.lua Normal file
View file

@ -0,0 +1,19 @@
require("config.lazy")
-- Enables LSPs
vim.lsp.enable({ "lua_ls", "nixd" })
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "grn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "gra", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "grr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, opts)
end,
})

4
lazy-lock.json Normal file
View file

@ -0,0 +1,4 @@
{
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }
}

15
lsp/lua_ls.lua Normal file
View file

@ -0,0 +1,15 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
settings = {
Lua = {
runtime = { version = "LuaJIT" },
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file("", true),
},
diagnostics = { globals = { "vim" } },
telemetry = { enable = false }
},
},
}

11
lsp/nixd.lua Normal file
View file

@ -0,0 +1,11 @@
return {
cmd = { "nixd" },
filetypes = { "nix" },
settings = {
nixd = {
formatting = {
command = { "nixfmt" },
},
},
},
}

35
lua/config/lazy.lua Normal file
View file

@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("settings")
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "plugins" },
},
checker = {
enabled = true,
notify = false,
},
})

6
lua/plugins/theme.lua Normal file
View file

@ -0,0 +1,6 @@
return {
"ellisonleao/gruvbox.nvim",
priority = 1000,
config = true,
opts = ...,
}

33
lua/settings.lua Normal file
View file

@ -0,0 +1,33 @@
-- Line numbers
vim.opt.number = true -- show absolute line numbers
vim.opt.relativenumber = true -- show relative line numbers
-- Mouse & clipboard
vim.opt.mouse = "a" -- enable mouse support
vim.opt.clipboard = "unnamedplus" -- use system clipboard
-- Visual behavior
vim.opt.termguicolors = true -- enable true colors
vim.opt.cursorline = true -- highlight the current line
vim.opt.wrap = false -- do not wrap long lines
vim.opt.signcolumn = "yes" -- always show the sign number (LSP, git)
-- Scrolling
vim.opt.scrolloff = 8 -- keep space above/below cursor
vim.opt.sidescrolloff = 8 -- keep space left/right of cursor
-- Indentation
vim.opt.expandtab = true -- use spaces instead of tabs
vim.opt.tabstop = 2 -- how many spaces a tab looks like
vim.opt.shiftwidth = 2 -- how many spaces when indenting
-- Search
vim.opt.ignorecase = true -- case-insensitive search
vim.opt.smartcase = true -- case-sensitive if uppercase is used
vim.opt.incsearch = true -- show matches while typing
vim.opt.hlsearch = false -- do not keep matches highlighted
-- Window splits
vim.opt.splitbelow = true -- horizontal splits open below
vim.opt.splitright = true -- vertical splits open to the right