Nix #3

Merged
DashieTM merged 10 commits from nix into main 2024-05-12 23:29:50 +02:00
20 changed files with 798 additions and 813 deletions
Showing only changes of commit cf63b635ac - Show all commits

View file

@ -32,16 +32,18 @@
cantarell-fonts
];
environment.variables = {
NIX_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (config.systemd.packages ++ config.environment.systemPackages);
PKG_CONFIG_PATH = pkgs.lib.makeLibraryPath (config.systemd.packages ++ config.environment.systemPackages);
};
nix.settings.experimental-features = "nix-command flakes";
programs.fish.enable = true;
programs.fish.promptInit = ''
${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source
'';
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
jdk
zlib
];
programs.dconf.enable = true;
services.upower.enable = true;
services.printing.enable = true;
@ -72,4 +74,8 @@
};
};
programs.ssh.startAgent = true;
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "dashie" ];
virtualisation.virtualbox.guest.enable = true;
}

68
nix/flake.lock generated
View file

@ -107,6 +107,24 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -345,6 +363,22 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1706487304,
"narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "90f456026d284c22b3e3497be980b2e47d0b28ac",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"Hyprspace": "Hyprspace",
@ -353,7 +387,8 @@
"hyprland": "hyprland",
"ironbar": "ironbar",
"nix-flatpak": "nix-flatpak",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay_2"
}
},
"rust-overlay": {
@ -378,6 +413,22 @@
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1713579131,
"narHash": "sha256-j/lrqFNzm7SdlBlKX43kA2Wp0OaGVOUjQGnER9//4Ao=",
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
@ -408,6 +459,21 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {

View file

@ -21,6 +21,9 @@
url = "github:JakeStanger/ironbar";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
};
anyrun.url = "github:Kirottu/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
@ -35,10 +38,9 @@
};
overlays = [
# because allowing rust nightly is too hard by default....
(import (fetchTarball {
url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
sha256 = "sha256:1aaza47rqi74ypi77ksz396q9l7rrxfrdnhi2pfjb0yqmz7l69wl";
}))
(import
inputs.rust-overlay
)
];
};
base_imports = [

View file

@ -5,4 +5,8 @@
"amdgpu.ppfeaturemask=0xffffffff"
];
networking.hostName = "spaceship";
environment.systemPackages = with pkgs; [
linuxKernel.packages.linux_zen.virtualbox
];
}

View file

@ -0,0 +1,92 @@
{ stdenv
, lib
, pkgs
, fetchFromGitLab
, nix-update-script
}:
pkgs.python3.pkgs.buildPythonApplication rec {
pname = "cambalache";
version = "0.90.1";
format = "other";
# Did not fetch submodule since it is only for tests we don't run.
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "jpu";
repo = pname;
rev = version;
sha256 = "sha256-YuRxqrGJvhMMZApD/tQSWkUg/nZnp/xryBJSjXCXO4w=";
};
nativeBuildInputs = with pkgs; [
meson
ninja
pkg-config
gobject-introspection # for setup hook
desktop-file-utils # for update-desktop-database
shared-mime-info # for update-mime-database
wrapGAppsHook
];
pythonPath = with pkgs.python3.pkgs; [
pygobject3
lxml
];
buildInputs = with pkgs; [
glib
gtk3
gtk4
gtksourceview4
gtksourceview5
webkitgtk_4_1
webkitgtk_6_0
# For extra widgets support.
libadwaita
libhandy
];
# Prevent double wrapping.
dontWrapGApps = true;
postPatch = ''
patchShebangs postinstall.py
# those programs are used at runtime not build time
# https://gitlab.gnome.org/jpu/cambalache/-/blob/0.12.1/meson.build#L79-80
substituteInPlace ./meson.build \
--replace "find_program('broadwayd', required: true)" "" \
--replace "find_program('gtk4-broadwayd', required: true)" ""
'';
preFixup = ''
# Let python wrapper use GNOME flags.
makeWrapperArgs+=(
# For broadway daemons
--prefix PATH : "${lib.makeBinPath [ pkgs.gtk3 pkgs.gtk4 ]}"
"''${gappsWrapperArgs[@]}"
)
'';
postFixup = ''
# Wrap a helper script in an unusual location.
wrapPythonProgramsIn "$out/${pkgs.python3.sitePackages}/cambalache/priv/merengue" "$out $pythonPath"
'';
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
homepage = "https://gitlab.gnome.org/jpu/cambalache";
description = "RAD tool for GTK 4 and 3 with data model first philosophy";
mainProgram = "cambalache";
maintainers = teams.gnome.members;
license = with licenses; [
lgpl21Only # Cambalache
gpl2Only # tools
];
platforms = platforms.unix;
};
}

View file

@ -32,7 +32,6 @@ rustPlatform.buildRustPackage rec {
libadwaita
];
postInstall = ''
install -D --mode=444 $src/${pname}.desktop $out/share/applications/${pname}.desktop
install -D --mode=444 $src/${pname}.svg $out/share/pixmaps/${pname}.svg

53
nix/override/reset.nix Normal file
View file

@ -0,0 +1,53 @@
{ pkgs
, lib
, fetchFromGitHub
}:
let
toolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal);
rustPlatform = pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
in
rustPlatform.buildRustPackage rec {
pname = "reset";
version = "1.1.1";
src = fetchFromGitHub {
owner = "Xetibo";
repo = "ReSet";
rev = "${version}";
hash = "sha256-nyEGhD4IlsJ1AqRZC7aP2vOuq4etvZ7BwTMxb4u7cxY=";
};
cargoHash = "sha256-lcNu8yEQiSTshXCwblBLYpSJWmErS53z+SviqaqlSnI=";
nativeBuildInputs = with pkgs;[
pkg-config
glib
wrapGAppsHook4
];
buildInputs = with pkgs;[
gtk4
libadwaita
pulseaudio
dbus
gdk-pixbuf
gnome.adwaita-icon-theme
];
postInstall = ''
install -D --mode=444 $src/${pname}.desktop $out/share/applications/${pname}.desktop
install -D --mode=444 $src/src/resources/icons/ReSet.svg $out/share/pixmaps/ReSet.svg
'';
meta = with lib; {
description = "";
homepage = "https://github.com/Xetibo/ReSet";
changelog = "https://github.com/Xetibo/ReSet/releases/tag/${version}";
license = licenses.gpl3;
maintainers = with maintainers; [ DashieTM ];
mainProgram = "reset";
};
}

View file

@ -17,13 +17,21 @@
deno
python3
typst
typst-lsp
typstfmt
neovide
tree-sitter
dotnet-runtime_8
dotnet-sdk
unzip
pkg-config
sqlite
plantuml
vscodium
gradle
maven
jdt-language-server
adoptopenjdk-jre-bin
#vscode-extensions.vscjava.vscode-java-test
#vscode-extensions.vscjava.vscode-java-debug
];
}

View file

@ -47,6 +47,7 @@ in
playerctl
ncspot
poppler_utils
neofetch
(callPackage
../override/oxinoti.nix
{ })
@ -65,6 +66,12 @@ in
(callPackage
../override/streamdeck.nix
{ })
(callPackage
../override/reset.nix
{ })
(callPackage
../override/cambalache.nix
{ })
];
home.username = "dashie";

View file

@ -13,6 +13,7 @@
wine
];
hardware.xone.enable = true;
programs.steam.enable = true;
programs.gamemode.enable = true;
programs.gamemode = {

View file

@ -60,12 +60,16 @@
nvim-lspconfig
nvim-notify
nvim-spectre
nvim-treesitter
nvim-treesitter.withAllGrammars
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-ts-autotag
nvim-ts-context-commentstring
nvim-web-devicons
nvim-jdtls
neotest
neotest-java
neotest-rust
persistence-nvim
plenary-nvim
telescope-fzf-native-nvim
@ -97,6 +101,18 @@
defaults = {
lazy = true,
},
performance = {
rtp = {
disabled_plugins = {
"gzip",
"netrw",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
dev = {
-- reuse files from pkgs.vimPlugins.*
path = "${lazyPath}",
@ -107,8 +123,6 @@
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "lazyvim.plugins.extras.ui.alpha" },
{ import = "plugins" },
{ import = "plugins.plugins" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.tailwind" },
{ import = "lazyvim.plugins.extras.lang.java" },
@ -127,27 +141,15 @@
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = true },
-- disable mason.nvim, use programs.neovim.extraPackages
{ "williamboman/mason-lspconfig.nvim", enabled = false },
{ "williamboman/mason.nvim", enabled = false },
-- import/override with your plugins
{ import = "plugins" },
--{ "williamboman/mason.nvim", enabled = false },
-- treesitter handled by xdg.configFile."nvim/parser", put this line at the end of spec to clear ensure_installed
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } },
{ import = "plugins" },
{ import = "plugins.plugins" },
},
install = { colorscheme = { "tokyonight" } },
checker = { enabled = true, notify = false },
change_detection = { enabled = true, notify = false },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"netrw",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
'';
};
@ -157,14 +159,12 @@
let
parsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
paths = (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: with plugins; [
c
lua
])).dependencies;
paths = (pkgs.vimPlugins.nvim-treesitter.withAllGrammars).dependencies;
};
in
"${parsers}/parser";
# Normal LazyVim config here, see https://github.com/LazyVim/starter/tree/main/lua
xdg.configFile."nvim/lua".source = ./lua;
xdg.configFile."nvim/ftplugin".source = ./ftplugin;
}

View file

@ -0,0 +1,5 @@
local config = {
cmd = { "jdtls" },
root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]),
}
require("jdtls").start_or_attach(config)

View file

@ -0,0 +1,16 @@
-- nvimtree
local function open_nvim_tree(data)
local directory = vim.fn.isdirectory(data.file) == 1
if not directory then
return
end
print("FUCK")
-- change to the directory
vim.cmd.cd(data.file)
-- open the tree
require("nvim-tree.api").tree.open()
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })

View file

@ -1,14 +1,14 @@
local Util = require("lazyvim.util")
local function map(mode, lhs, rhs, opts)
local keys = require("lazy.core.handler").handlers.keys
---@cast keys LazyKeysHandler
-- do not create the map if a lazy keys handler exists
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
opts = opts or {}
opts.silent = opts.silent ~= false
vim.keymap.set(mode, lhs, rhs, opts)
end
local keys = require("lazy.core.handler").handlers.keys
---@cast keys LazyKeysHandler
-- do not create the map if a lazy keys handler exists
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
opts = opts or {}
opts.silent = opts.silent ~= false
vim.keymap.set(mode, lhs, rhs, opts)
end
end
local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
@ -32,10 +32,10 @@ map("n", "<leader>do", ':lua require("dap").step_over()<CR>', { desc = "Step ove
map("n", "<leader>di", ':lua require("dap").step_into()<CR>', { desc = "Step into" })
map("n", "<leader>dc", ':lua require("dap").continue()<CR>', { desc = "Continue" })
map("n", "<leader>du", function()
require("dapui").toggle()
require("dapui").toggle()
end, { desc = "Toggle DAP UI" })
map("n", "<leader>de", function()
require("dapui").eval()
require("dapui").eval()
end, { desc = "DAP Eval" })
-- window movement
@ -48,7 +48,7 @@ map("i", "<A-k>", [[<Cmd>wincmd j<CR>]], opts)
-- toggle terminal
local lazyterm = function()
Util.terminal(nil, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false })
Util.terminal(nil, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false })
end
map("n", "<c-t>", lazyterm, { desc = "Terminal (root dir)" })
map("t", "<c-t>", "<cmd>close<cr>", { desc = "Hide Terminal" })
@ -65,70 +65,70 @@ map("n", "<F2>", ":BufferLineCycleNext<CR>", opts)
-- git
map("n", "<leader>gq", function()
require("telescope.builtin").git_commits()
require("telescope.builtin").git_commits()
end, { desc = "Commits" })
map("n", "<leader>gw", function()
require("telescope.builtin").git_bcommits()
require("telescope.builtin").git_bcommits()
end, { desc = "Commits in branch" })
map("n", "<leader>gb", function()
require("telescope.builtin").git_branches()
require("telescope.builtin").git_branches()
end, { desc = "Branches" })
map("n", "<leader>gr", function()
require("telescope.builtin").git_status()
require("telescope.builtin").git_status()
end, { desc = "Git status" })
map("n", "<leader>ga", function()
require("telescope.builtin").git_stash()
require("telescope.builtin").git_stash()
end, { desc = "Git stash" })
map("n", "<leader>gg", function()
Util.terminal({ "gitui" }, { cwd = Util.root() })
Util.terminal({ "gitui" }, { cwd = Util.root() })
end, { desc = "gitui (root dir)" })
map("n", "<leader>gG", function()
Util.terminal({ "gitui" })
Util.terminal({ "gitui" })
end, { desc = "gitui (cwd)" })
map("n", "<leader>gB", function()
require("gitblame")
vim.cmd(":GitBlameToggle")
require("gitblame")
vim.cmd(":GitBlameToggle")
end, { desc = "git blame" })
-- harpoon man
map("n", "<leader>h1", function()
require("harpoon.ui").nav_file(1)
require("harpoon.ui").nav_file(1)
end, { desc = "First Harpoon File" })
map("n", "<leader>h2", function()
require("harpoon.ui").nav_file(2)
require("harpoon.ui").nav_file(2)
end, { desc = "Second Harpoon File" })
map("n", "<leader>h3", function()
require("harpoon.ui").nav_file(3)
require("harpoon.ui").nav_file(3)
end, { desc = "First Harpoon File" })
map("n", "<leader>ha", function()
require("harpoon.mark").add_file()
require("harpoon.mark").add_file()
end, { desc = "First Harpoon File" })
map("n", "<leader>hd", function()
require("harpoon.mark").remove_file()
require("harpoon.mark").remove_file()
end, { desc = "First Harpoon File" })
map("n", "<leader>hm", ":Telescope harpoon marks<CR>", { noremap = true, silent = true, desc = "Show harpoon marks" })
-- telescope
map("n", "<leader>fb", function()
require("telescope").extensions.file_browser.file_browser({})
require("telescope").extensions.file_browser.file_browser({})
end, { desc = "File Browser" })
map("n", "<leader>ff", function()
require("telescope.builtin").find_files()
require("telescope.builtin").find_files()
end, { desc = "Find Files" })
map("n", "<leader>fg", function()
Live_grep_from_project_git_root()
Live_grep_from_project_git_root()
end, { desc = "Live Grep (root)" })
map("n", "<leader>fG", function()
require("telescope.builtin").live_grep()
require("telescope.builtin").live_grep()
end, { desc = "Live Grep (cwd)" })
map("n", "<leader>fh", function()
require("telescope.builtin").help_tags()
require("telescope.builtin").help_tags()
end, { desc = "Help" })
map("n", "<leader>fp", function()
require("telescope").extensions.project.project({})
require("telescope").extensions.project.project({})
end, { noremap = true, silent = true, desc = "Projects" })
map("n", "<leader>z", function()
require("telescope").extensions.zoxide.list({})
require("telescope").extensions.zoxide.list({})
end, { desc = "Zoxide" })
-- neoscroll
@ -142,13 +142,13 @@ map("n", "<leader>t", "<cmd>TroubleToggle<CR>", term_opts)
-- format
map({ "n", "v" }, "<F4>", function()
Util.format({ force = true })
Util.format({ force = true })
end, { desc = "Format" })
-- better yank
function Better_yank(opts)
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "y")
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "y")
end
vim.api.nvim_create_user_command("BetterYank", Better_yank, { count = 1 })
@ -156,8 +156,8 @@ map("n", "by", ":BetterYank<CR>", term_opts)
-- better delete
function Better_delete(opts)
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "d")
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "d")
end
vim.api.nvim_create_user_command("BetterDelete", Better_delete, { count = 1 })
@ -165,13 +165,13 @@ map("n", "bd", ":BetterDelete<CR>", term_opts)
-- neovide zoom
local change_scale_factor = function(delta)
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
end
vim.keymap.set("n", "<C-=>", function()
change_scale_factor(1.25)
change_scale_factor(1.25)
end)
vim.keymap.set("n", "<C-->", function()
change_scale_factor(1 / 1.25)
change_scale_factor(1 / 1.25)
end)
-- neovide paste
@ -179,23 +179,24 @@ vim.g.neovide_input_use_logo = 1
vim.api.nvim_set_keymap("i", "<C-S-V>", "<ESC>p<CR>I", { noremap = true, silent = true })
function Get_git_root()
local opts = {}
local function is_git_repo()
vim.fn.system("git rev-parse --is-inside-work-tree")
local opts = {}
local function is_git_repo()
vim.fn.system("git rev-parse --is-inside-work-tree")
return vim.v.shell_error == 0
end
if is_git_repo() then
local dot_git_path = vim.fn.finddir(".git", ".;")
local root = vim.fn.fnamemodify(dot_git_path, ":h")
opts = {
cwd = root,
}
end
return opts
return vim.v.shell_error == 0
end
if is_git_repo() then
local dot_git_path = vim.fn.finddir(".git", ".;")
local root = vim.fn.fnamemodify(dot_git_path, ":h")
opts = {
cwd = root,
}
end
return opts
end
function Live_grep_from_project_git_root()
local opts = Get_git_root()
require("telescope.builtin").live_grep(opts)
local opts = Get_git_root()
require("telescope.builtin").live_grep(opts)
end

View file

@ -2,24 +2,32 @@
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
local options = {
fileencoding = "utf-8",
number = true,
showmode = true,
termguicolors = true,
spelllang = "en_us",
shell = "fish",
relativenumber = false,
scrolloff = 5,
scrolljump = 5,
wrap = false,
fileencoding = "utf-8",
number = true,
showmode = true,
termguicolors = true,
spelllang = "en_us",
shell = "fish",
relativenumber = false,
scrolloff = 5,
scrolljump = 5,
wrap = false,
}
vim.filetype.add({
extension = {
typst = "typst",
typ = "typst",
},
})
vim.o.guifont = "JetBrainsMono Nerd Font:h14"
vim.g.neovide_refresh_rate_idle = 180
vim.g.neovide_refresh_rate_idle = 5
vim.g.neovide_hide_mouse_when_typing = true
vim.g.mkdp_browser = "/usr/bin/firefox"
vim.g.mkdp_auto_start = 1
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.autoformat = false
for k, v in pairs(options) do
vim.opt[k] = v
vim.opt[k] = v
end

View file

@ -1,302 +0,0 @@
local Util = require("lazyvim.util")
return {
{
"LazyVim/LazyVim",
opts = {
colorscheme = "tokyonight-night",
-- colorscheme = "catppuccin-mocha",
},
},
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
keys = function()
return {}
end,
opts = {
defaults = {
layout_strategy = 'flex';
layout_config = {
flex = {
height = 0.95,
width = 0.95,
flip_columns = 100,
vertical = { preview_height = 0.5, preview_cutoff = 5 },
horizontal = { preview_width = 0.7, preview_cutoff = 99 },
},
},
},
},
},
{
"ThePrimeagen/harpoon",
lazy = true,
config = function()
require("telescope").load_extension("harpoon")
end,
},
{
"iamcco/markdown-preview.nvim",
lazy = true,
event = "FileType markdown",
build = "cd app && yarn install",
},
{
"nvim-telescope/telescope-project.nvim",
lazy = true,
},
{
"nvim-telescope/telescope-file-browser.nvim",
lazy = true,
config = function()
require("telescope").load_extension("file_browser")
end,
},
{
"jvgrootveld/telescope-zoxide",
lazy = true,
config = function()
local z_utils = require("telescope._extensions.zoxide.utils")
local t = require("telescope")
-- Configure the extension
t.setup({
extensions = {
zoxide = {
prompt_title = "[ Queries ]",
mappings = {
default = {
after_action = function(selection)
print("Update to (" .. selection.z_score .. ") " .. selection.path)
end,
},
["<C-s>"] = {
before_action = function(selection)
print("before C-s")
end,
action = function(selection)
vim.cmd("edit " .. selection.path)
end,
},
["<C-q>"] = { action = z_utils.create_basic_command("split") },
},
},
},
})
-- Load the extension
t.load_extension("zoxide")
end,
},
{
"lervag/vimtex",
config = function()
vim.cmd("let g:vimtex_quickfix_mode=0")
vim.cmd("let g:vimtex_view_general_viewer = 'evince'")
vim.cmd("let g:vimtex_compiler_method = 'latexmk'")
vim.cmd(
"let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}"
)
end,
},
{
"rcarriga/nvim-notify",
opts = {
top_down = false,
},
},
{
"jbyuki/instant.nvim",
config = function()
vim.cmd("let g:instant_username = 'dashie'")
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
},
},
},
{
"karb94/neoscroll.nvim",
config = function()
require("neoscroll").setup()
end,
},
{
"kaarmu/typst.vim",
lazy = true,
event = "FileType typst",
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = { spelling = true },
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>h"] = { name = "+harpoon" },
["<leader>d"] = { name = "+DAP" },
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
{
"f-person/git-blame.nvim",
lazy = true,
},
{
"mg979/vim-visual-multi",
},
{
"barreiroleo/ltex_extra.nvim",
ft = { "markdown", "tex", "typst", "typ" },
lazy = true,
},
{
"smjonas/inc-rename.nvim",
lazy = true,
event = "BufEnter",
config = function()
require("inc_rename").setup({
cmd_name = "IncRename", -- the name of the command
hl_group = "Substitute", -- the highlight group used for highlighting the identifier's new name
preview_empty_name = true, -- whether an empty new name should be previewed; if false the command preview will be cancelled instead
show_message = true, -- whether to display a `Renamed m instances in n files` message after a rename operation
input_buffer_type = nil, -- the type of the external input buffer to use (the only supported value is currently "dressing")
post_hook = nil, -- callback to run after renaming, receives the result table (from LSP handler) as an argument
})
end,
},
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
window = {
position = "right",
mappings = {
["l"] = "none",
},
},
},
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({ position = "right", toggle = true, dir = Util.root() })
end,
desc = "Explorer NeoTree (root dir)",
},
{
"<leader>fE",
function()
require("neo-tree.command").execute({ position = "right", toggle = true, dir = vim.loop.cwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
{ "<A-f>", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
{ "<A-F>", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
},
},
{
"folke/edgy.nvim",
opts = {
animate = {
enabled = false,
},
left = {},
right = {
-- Neo-tree filesystem always takes half the screen height
{
title = "Neo-Tree",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "filesystem"
end,
size = { height = 0.5 },
},
{
title = "Neo-Tree Git",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "git_status"
end,
pinned = true,
open = "Neotree position=right git_status",
},
{
title = "Neo-Tree Buffers",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == "buffers"
end,
pinned = true,
open = "Neotree position=top buffers",
},
{
ft = "Outline",
pinned = true,
open = "SymbolsOutlineOpen",
},
-- any other neo-tree windows
"neo-tree",
},
},
},
{
"rcarriga/nvim-dap-ui",
keys = {
{
"<leader>dk",
function()
require("dap").down()
end,
desc = "Down",
},
{
"<leader>dl",
function()
require("dap").up()
end,
desc = "Up",
},
{
"<leader>d;",
function()
require("dap").run_last()
end,
desc = "Run Last",
},
},
},
}

View file

@ -5,4 +5,5 @@ return {
{ { "folke/noice.nvim", enabled = false } },
{ { "nvimtools/none-ls.nvim", enabled = false } },
{ { "nvimdev/dashboard-nvim", enabled = false } },
{ { "nvim-neo-tree/neo-tree.nvim", enabled = false } },
}

View file

@ -1,162 +1,164 @@
return {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {},
},
},
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
-- inlay_hints = {
-- enabled = true,
-- },
format_notify = false,
-- LSP Server Settings
---@type lspconfig.options
servers = {
rust_analyzer = {
mason = false,
},
marksman = {
mason = false,
},
clangd = {
mason = false,
},
jdtls = {
mason = false,
},
gopls = {
mason = false,
},
pyright = {
mason = false,
},
ruff_lsp = {
mason = false,
},
texlab = {
mason = false,
},
taplo = {
keys = {
{
"K",
function()
if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
require("crates").show_popup()
else
vim.lsp.buf.hover()
end
end,
desc = "Show Crate Documentation",
},
},
mason = false,
},
bashls = {
mason = false,
},
ansiblels = {
mason = false,
},
typst_lsp = {
settings = {
experimentalFormatterMode = "on",
exportPdf = "onSave",
},
mason = false,
},
nil_ls = {
settings = {
["nil"] = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
mason = false,
},
ltex = {
settings = {
ltex = {
checkFrequency = "save",
},
},
filetypes = {
"bib",
"gitcommit",
"markdown",
"org",
"plaintex",
"rst",
"rnoweb",
"tex",
"pandoc",
"typst",
"typ",
},
mason = false,
},
sqlls = {
mason = false,
},
lemminx = {
mason = false,
},
opencl_ls = {
mason = false,
},
yamlls = {
mason = false,
},
lua_ls = {
mason = false,
{
Lua = {
workspace = {
checkThirdParty = false,
},
completion = {
callSnippet = "Replace",
},
},
},
},
},
},
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
local my_keys = require("config.lsp-keymap").get()
local count = 0
for _ in pairs(my_keys) do
keys[#keys + 1] = my_keys[count]
count = count + 1
end
end,
},
{
"stevearc/conform.nvim",
opts = {
keys = {
{
-- Customize or remove this keymap to your liking
"<leader>cF",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
},
formatters_by_ft = {
typst = { "typstfmt" },
nix = { "nixpkgs-fmt" },
lua = { "stylua" },
sh = { "shfmt" },
},
},
},
{
"williamboman/mason.nvim",
--opts = function()
-- return {
-- ensure_installed = {},
-- }
--end,
},
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
-- inlay_hints = {
-- enabled = true,
-- },
format_notify = false,
-- LSP Server Settings
---@type lspconfig.options
servers = {
rust_analyzer = {
mason = false,
},
marksman = {
mason = false,
},
clangd = {
mason = false,
},
jdtls = {
mason = false,
},
gopls = {
mason = false,
},
pyright = {
mason = false,
},
ruff_lsp = {
mason = false,
},
texlab = {
mason = false,
},
taplo = {
keys = {
{
"K",
function()
if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then
require("crates").show_popup()
else
vim.lsp.buf.hover()
end
end,
desc = "Show Crate Documentation",
},
},
mason = false,
},
bashls = {
mason = false,
},
ansiblels = {
mason = false,
},
typst_lsp = {
settings = {
experimentalFormatterMode = "on",
exportPdf = "onSave",
},
mason = false,
},
nil_ls = {
settings = {
["nil"] = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
mason = false,
},
ltex = {
settings = {
ltex = {
checkFrequency = "save",
},
},
filetypes = {
"bib",
"gitcommit",
"markdown",
"org",
"plaintex",
"rst",
"rnoweb",
"tex",
"pandoc",
"typst",
"typ",
},
mason = false,
},
sqlls = {
mason = false,
},
lemminx = {
mason = false,
},
opencl_ls = {
mason = false,
},
yamlls = {
mason = false,
},
lua_ls = {
mason = false,
{
Lua = {
workspace = {
checkThirdParty = false,
},
completion = {
callSnippet = "Replace",
},
},
},
},
},
},
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
local my_keys = require("config.lsp-keymap").get()
local count = 0
for _ in pairs(my_keys) do
keys[#keys + 1] = my_keys[count]
count = count + 1
end
end,
},
{
"stevearc/conform.nvim",
opts = {
keys = {
{
-- Customize or remove this keymap to your liking
"<leader>cF",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
},
formatters_by_ft = {
typst = { "typstfmt" },
nix = { "nixpkgs-fmt" },
lua = { "stylua" },
sh = { "shfmt" },
},
},
},
}

View file

@ -1,255 +1,273 @@
local Util = require("lazyvim.util")
return {
{
"LazyVim/LazyVim",
opts = {
colorscheme = "tokyonight-night",
-- colorscheme = "catppuccin-mocha",
},
},
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
keys = function()
return {}
end,
opts = {
defaults = {
layout_strategy = "flex",
layout_config = {
flex = {
height = 0.95,
width = 0.95,
flip_columns = 100,
},
vertical = { preview_height = 0.5, preview_cutoff = 5 },
horizontal = { preview_width = 0.7, preview_cutoff = 99 },
},
},
},
},
{
"nvim-telescope/telescope-project.nvim",
lazy = true,
},
{
"nvim-telescope/telescope-file-browser.nvim",
lazy = true,
config = function()
require("telescope").load_extension("file_browser")
end,
},
{
"jvgrootveld/telescope-zoxide",
lazy = true,
config = function()
local z_utils = require("telescope._extensions.zoxide.utils")
local t = require("telescope")
-- Configure the extension
t.setup({
extensions = {
zoxide = {
prompt_title = "[ Queries ]",
mappings = {
default = {
after_action = function(selection)
print("Update to (" .. selection.z_score .. ") " .. selection.path)
end,
},
["<C-s>"] = {
before_action = function(selection)
print("before C-s")
end,
action = function(selection)
vim.cmd("edit " .. selection.path)
end,
},
["<C-q>"] = { action = z_utils.create_basic_command("split") },
},
},
},
})
{
"LazyVim/LazyVim",
opts = {
colorscheme = "tokyonight-night",
-- colorscheme = "catppuccin-mocha",
},
},
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
keys = function()
return {}
end,
opts = {
defaults = {
layout_strategy = "flex",
layout_config = {
flex = {
height = 0.95,
width = 0.95,
flip_columns = 100,
},
vertical = { preview_height = 0.5, preview_cutoff = 5 },
horizontal = { preview_width = 0.7, preview_cutoff = 99 },
},
},
},
},
{
"nvim-telescope/telescope-project.nvim",
lazy = true,
},
{
"nvim-telescope/telescope-file-browser.nvim",
lazy = true,
config = function()
require("telescope").load_extension("file_browser")
end,
},
{
"jvgrootveld/telescope-zoxide",
lazy = true,
config = function()
local z_utils = require("telescope._extensions.zoxide.utils")
local t = require("telescope")
-- Configure the extension
t.setup({
extensions = {
zoxide = {
prompt_title = "[ Queries ]",
mappings = {
default = {
after_action = function(selection)
print("Update to (" .. selection.z_score .. ") " .. selection.path)
end,
},
["<C-s>"] = {
before_action = function(selection)
print("before C-s")
end,
action = function(selection)
vim.cmd("edit " .. selection.path)
end,
},
["<C-q>"] = { action = z_utils.create_basic_command("split") },
},
},
},
})
-- Load the extension
t.load_extension("zoxide")
end,
},
{
"lervag/vimtex",
config = function()
vim.cmd("let g:vimtex_quickfix_mode=0")
vim.cmd("let g:vimtex_view_general_viewer = 'evince'")
vim.cmd("let g:vimtex_compiler_method = 'latexmk'")
vim.cmd(
"let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}"
)
end,
},
{
"jbyuki/instant.nvim",
config = function()
vim.cmd("let g:instant_username = 'dashie'")
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
},
},
},
{
"karb94/neoscroll.nvim",
config = function()
require("neoscroll").setup()
end,
},
{
"kaarmu/typst.vim",
lazy = true,
event = "FileType typst",
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = { spelling = true },
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>h"] = { name = "+harpoon" },
["<leader>d"] = { name = "+DAP" },
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
{
"f-person/git-blame.nvim",
lazy = true,
},
{
"mg979/vim-visual-multi",
},
{
"barreiroleo/ltex_extra.nvim",
ft = { "markdown", "tex", "typst", "typ" },
lazy = true,
},
{
"smjonas/inc-rename.nvim",
lazy = true,
event = "BufEnter",
config = function()
require("inc_rename").setup({
cmd_name = "IncRename", -- the name of the command
hl_group = "Substitute", -- the highlight group used for highlighting the identifier's new name
preview_empty_name = true, -- whether an empty new name should be previewed; if false the command preview will be cancelled instead
show_message = true, -- whether to display a `Renamed m instances in n files` message after a rename operation
input_buffer_type = nil, -- the type of the external input buffer to use (the only supported value is currently "dressing")
post_hook = nil, -- callback to run after renaming, receives the result table (from LSP handler) as an argument
})
end,
},
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
window = {
position = "right",
mappings = {
["l"] = "none",
},
},
},
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({ position = "right", toggle = true, dir = Util.root() })
end,
desc = "Explorer NeoTree (root dir)",
},
{
"<leader>fE",
function()
require("neo-tree.command").execute({ position = "right", toggle = true, dir = vim.loop.cwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
{ "<A-f>", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
{ "<A-F>", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
},
},
{
"rcarriga/nvim-dap-ui",
keys = {
{
"<leader>dk",
function()
require("dap").down()
end,
desc = "Down",
},
{
"<leader>dl",
function()
require("dap").up()
end,
desc = "Up",
},
{
"<leader>d;",
function()
require("dap").run_last()
end,
desc = "Run Last",
},
},
},
{
"DashieTM/test_plugin",
lazy = false,
opts = {
what = 0,
},
},
{
"DreamMaoMao/yazi.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
keys = {
{ "<leader>fy", "<cmd>Yazi<CR>", desc = "Toggle Yazi" },
},
},
-- Load the extension
t.load_extension("zoxide")
end,
},
{
"lervag/vimtex",
config = function()
vim.cmd("let g:vimtex_quickfix_mode=0")
vim.cmd("let g:vimtex_view_general_viewer = 'evince'")
vim.cmd("let g:vimtex_compiler_method = 'latexmk'")
vim.cmd(
"let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}"
)
end,
},
{
"jbyuki/instant.nvim",
config = function()
vim.cmd("let g:instant_username = 'dashie'")
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
},
},
},
{
"karb94/neoscroll.nvim",
config = function()
require("neoscroll").setup()
end,
},
{
"kaarmu/typst.vim",
lazy = true,
event = "FileType typst",
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = { spelling = true },
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>h"] = { name = "+harpoon" },
["<leader>d"] = { name = "+DAP" },
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
{
"f-person/git-blame.nvim",
lazy = true,
},
{
"mg979/vim-visual-multi",
},
{
"barreiroleo/ltex_extra.nvim",
ft = { "markdown", "tex", "typst", "typ" },
lazy = true,
},
{
"smjonas/inc-rename.nvim",
lazy = true,
event = "BufEnter",
config = function()
require("inc_rename").setup({
cmd_name = "IncRename", -- the name of the command
hl_group = "Substitute", -- the highlight group used for highlighting the identifier's new name
preview_empty_name = true, -- whether an empty new name should be previewed; if false the command preview will be cancelled instead
show_message = true, -- whether to display a `Renamed m instances in n files` message after a rename operation
input_buffer_type = nil, -- the type of the external input buffer to use (the only supported value is currently "dressing")
post_hook = nil, -- callback to run after renaming, receives the result table (from LSP handler) as an argument
})
end,
},
{
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("nvim-tree").setup({
renderer = {
group_empty = true,
},
view = {
side = "right",
},
})
end,
keys = {
{
"<leader>fe",
function()
require("nvim-tree.api").tree.toggle()
end,
desc = "Explorer NvimTree (root dir)",
},
{
"<leader>fE",
function()
require("nvim-tree.api").tree.toggle()
end,
desc = "Explorer NvimTree (cwd)",
},
{ "<A-f>", "<leader>fe", desc = "Explorer NvimTree (root dir)", remap = true },
{ "<A-F>", "<leader>fE", desc = "Explorer NvimTree (cwd)", remap = true },
},
},
{
"rcarriga/nvim-dap-ui",
keys = {
{
"<leader>dk",
function()
require("dap").down()
end,
desc = "Down",
},
{
"<leader>dl",
function()
require("dap").up()
end,
desc = "Up",
},
{
"<leader>d;",
function()
require("dap").run_last()
end,
desc = "Run Last",
},
},
},
{
"nvim-neotest/neotest",
dependencies = {
"rcasia/neotest-java",
},
opts = {
adapters = {
["neotest-java"] = {
ignore_wrapper = false, -- whether to ignore maven/gradle wrapper
junit_jar = "/home/dashie/.local/share/nvim/mason/bin/junit-standalone.jar",
-- default: .local/share/nvim/neotest-java/junit-platform-console-standalone-[version].jar
},
},
},
},
{
"DashieTM/test_plugin",
lazy = false,
opts = {
what = 0,
},
},
{
"DreamMaoMao/yazi.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
keys = {
{ "<leader>fy", "<cmd>Yazi<CR>", desc = "Toggle Yazi" },
},
},
}

View file

@ -1,7 +1,5 @@
ncspot() {
notify-send "$1"
notify-send "$2"
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"