1

Compare commits

...

5 Commits

4 changed files with 223 additions and 8 deletions

View File

@ -269,7 +269,9 @@ rec {
}; };
# Files to generate in the home directory are specified here. # Files to generate in the home directory are specified here.
file = { file = let
sshPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJAoJac+GdGtzblCMA0lBfMdSR6aQ4YyovrNglCFGIny christoph.urlacher@protonmail.com";
in {
# Generate a list of installed user packages in ~/.local/share/current-user-packages # Generate a list of installed user packages in ~/.local/share/current-user-packages
".local/share/current-user-packages".text = let ".local/share/current-user-packages".text = let
packages = builtins.map (p: "${p.name}") home.packages; packages = builtins.map (p: "${p.name}") home.packages;
@ -280,6 +282,9 @@ rec {
# TODO: If navi enabled # TODO: If navi enabled
".local/share/navi/cheats/christoph.cheat".source = config.lib.file.mkOutOfStoreSymlink "${config.paths.dotfiles}/navi/christoph.cheat"; ".local/share/navi/cheats/christoph.cheat".source = config.lib.file.mkOutOfStoreSymlink "${config.paths.dotfiles}/navi/christoph.cheat";
".ssh/id_ed25519.pub".text = "${sshPublicKey}";
".ssh/allowed_signers".text = "* ${sshPublicKey}";
}; };
# Here, custom scripts can be run when activating a HM generation. # Here, custom scripts can be run when activating a HM generation.
@ -314,6 +319,7 @@ rec {
nvd # nix rebuild diff nvd # nix rebuild diff
ripdrag # drag & drop from terminal ripdrag # drag & drop from terminal
playerctl # media player control playerctl # media player control
pastel # color tools
# Hardware/Software info # Hardware/Software info
pciutils # lspci pciutils # lspci
@ -451,10 +457,101 @@ rec {
git = { git = {
enable = true; enable = true;
lfs.enable = true;
userEmail = "christoph.urlacher@protonmail.com"; userEmail = "christoph.urlacher@protonmail.com";
userName = "Christoph Urlacher"; userName = "Christoph Urlacher";
signing = {
signByDefault = true;
format = "ssh";
key = "~/.ssh/id_ed25519.pub";
};
lfs.enable = true;
diff-so-fancy = {
enable = true;
changeHunkIndicators = true;
markEmptyLines = false;
stripLeadingSymbols = true;
};
extraConfig = {
core = {
compression = 9;
# whitespace = "error";
preloadindex = true;
};
init = {
defaultBranch = "main";
};
gpg = {
ssh = {
allowedSignersFile = "~/.ssh/allowed_signers";
};
};
status = {
branch = true;
showStash = true;
showUntrackedFiles = "all";
};
pull = {
default = "current";
rebase = true;
};
push = {
autoSetupRemote = true;
default = "current";
followTags = true;
};
rebase = {
autoStash = true;
missingCommitsCheck = "warn";
};
diff = {
context = 3;
renames = "copies";
interHunkContext = 10;
};
interactive = {
diffFilter = "${pkgs.diff-so-fancy}/bin/diff-so-fancy --patch";
singlekey = true;
};
log = {
abbrevCommit = true;
graphColors = "blue,yellow,cyan,magenta,green,red";
};
branch = {
sort = "-committerdate";
};
tag = {
sort = "-taggerdate";
};
pager = {
branch = false;
tag = false;
};
url = {
"ssh://git@gitea.local.chriphost.de:222/christoph/" = {
insteadOf = "gitea:";
};
"git@github.com:" = {
insteadOf = "github:";
};
};
};
}; };
keychain = { keychain = {
@ -501,7 +598,25 @@ rec {
}; };
nushell.enable = false; nushell.enable = false;
ssh.enable = false; # NOTE: Do NOT generate .ssh/config using HM, as it will have invalid permissions! ssh = {
enable = true; # NOTE: Do NOT generate .ssh/config using HM, as it will have invalid permissions!
compression = true;
matchBlocks = {
"servenix" = {
user = "christoph";
hostname = "local.chriphost.de";
};
"thinknix" = {
user = "christoph";
hostname = "think.chriphost.de";
};
"vps" = {
user = "root";
hostname = "vps.chriphost.de";
};
};
};
tmux = { tmux = {
enable = false; enable = false;

View File

@ -169,9 +169,12 @@ in {
(abbrify pkgs.git { (abbrify pkgs.git {
gs = "git status"; gs = "git status";
gcm = "git commit -m"; gd = "git diff --output-indicator-new=' ' --output-indicator-old=' '";
gl = "git log --all --graph --pretty=format:'%C(magenta)%h %C(white) %an %ar%C(auto) %D%n%s%n'";
ga = "git add"; ga = "git add";
glg = "git log --graph --decorate --oneline"; gap = "git add --patch";
gc = "git commit --verbose";
gcm = "git commit -m";
gcl = "git clone"; gcl = "git clone";
}) })

View File

@ -571,6 +571,90 @@ in {
# Don't call setup! # Don't call setup!
}; };
hover = let
# Display LSP information and Diagnostics at the same time
# https://github.com/lewis6991/hover.nvim/issues/34#issuecomment-1625662866
lspWithDiag = ''
{
name = "LSP",
priority = 1000,
enabled = function()
return true
end,
execute = function(opts, done)
local params = vim.lsp.util.make_position_params()
local ___ = "\n\n"
vim.lsp.buf_request_all(0, 'textDocument/hover', params, function(responses)
local value = ""
for _, response in pairs(responses) do
local result = response.result
if result and result.contents and result.contents.value then
if value ~= "" then
value = value .. ___
end
value = value .. result.contents.value
end
end
local _, row = unpack(vim.fn.getpos("."))
local lineDiag = vim.diagnostic.get(0, { lnum = row - 1 })
for _, d in pairs(lineDiag) do
if d.message then
if value ~= "" then
value = value .. ___
end
value = value .. string.format("*%s* %s", d.source, d.message)
end
end
value = value:gsub("\r", "")
if value ~= "" then
done({ lines = vim.split(value, "\n", true), filetype = "markdown" })
else
done()
end
end)
end,
}
'';
in rec {
name = "hover";
pkg = pkgs.vimPlugins.hover-nvim;
lazy = true;
event = ["BufReadPost" "BufNewFile"];
config = mkDefaultConfig name;
opts = {
init.__raw = ''
function()
-- Register custom providers
require('hover').register(${lspWithDiag})
-- Require providers
-- require("hover.providers.lsp")
-- require('hover.providers.diagnostic')
require('hover.providers.fold_preview')
require('hover.providers.man')
-- require('hover.providers.gh')
-- require('hover.providers.gh_user')
-- require('hover.providers.jira')
-- require('hover.providers.dap')
-- require('hover.providers.dictionary')
-- require('hover.providers.highlight')
end
'';
preview_opts = {
border = "rounded";
};
# Whether the contents of a currently open hover window should be moved
# to a :h preview-window when pressing the hover keymap.
preview_window = false;
title = false;
};
};
illuminate = rec { illuminate = rec {
name = "illuminate"; name = "illuminate";
pkg = pkgs.vimPlugins.vim-illuminate; pkg = pkgs.vimPlugins.vim-illuminate;
@ -789,7 +873,7 @@ in {
}; };
}; };
} }
# {name = "nil_ls";} # Conflicts with nixd's hover {name = "nil_ls";}
{ {
name = "nixd"; name = "nixd";
extraOptions.cmd = [ extraOptions.cmd = [
@ -1859,6 +1943,7 @@ in {
flash # Highlight f/F search results flash # Highlight f/F search results
gitsigns # Show git line additions/deletions/changes in the gutter gitsigns # Show git line additions/deletions/changes in the gutter
haskell-tools # Haskell integration haskell-tools # Haskell integration
hover # Multiple hover providers
illuminate # Highlight usages of word under cursor illuminate # Highlight usages of word under cursor
intellitab # Indent to the correct level on blanklines # TODO: Behaves bit fishy sometimes intellitab # Indent to the correct level on blanklines # TODO: Behaves bit fishy sometimes

View File

@ -259,10 +259,16 @@ _: let
action = "<cmd>nohlsearch<cr>"; action = "<cmd>nohlsearch<cr>";
options.desc = "Clear Search Highlights"; options.desc = "Clear Search Highlights";
} }
# {
# mode = "n";
# key = "K";
# action = "<cmd>lua vim.lsp.buf.hover()<cr>";
# options.desc = "LSP Hover";
# }
{ {
mode = "n"; mode = "n";
key = "K"; key = "K";
action = "<cmd>lua vim.lsp.buf.hover()<cr>"; action = "<cmd>lua require('hover').hover()<cr>";
options.desc = "LSP Hover"; options.desc = "LSP Hover";
} }
{ {
@ -428,7 +434,13 @@ _: let
} }
{ {
mode = "n"; mode = "n";
key = "<leader>fN"; key = "<leader>fc";
action = "<cmd>edit ~/.config/nvim/init.lua<cr>";
options.desc = "Open Config";
}
{
mode = "n";
key = "<leader>fn";
action = "<cmd>enew<cr>"; action = "<cmd>enew<cr>";
options.desc = "New File"; options.desc = "New File";
} }