refactor: biggest cleanup of my life

This commit is contained in:
2026-02-19 16:29:24 +01:00
parent 94dc0e0927
commit c15e65fece
35 changed files with 104 additions and 260 deletions
+28
View File
@@ -0,0 +1,28 @@
{
osConfig ? null,
lib,
...
}:
let
mkDefaultSharedAttrs = defaults: lib.mapAttrs (_: v: lib.mkDefault v) defaults;
in
{
imports = [
./git.nix
./fish.nix
./nixvim
./hyprland.nix
./kitty.nix
./rofi
];
kekleo = lib.mkIf (osConfig != null) (mkDefaultSharedAttrs (osConfig.kekleo or { }));
programs.home-manager.enable = true;
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "25.11";
}
+27
View File
@@ -0,0 +1,27 @@
{ pkgs, lib, ... }:
{
programs.fish = {
enable = true;
interactiveShellInit = ''
# no greeting
set fish_greeting
# vi key binds
set -g fish_key_bindings fish_vi_key_bindings
# accept completion with ctrl-y
bind --mode insert \cy forward-char
'';
shellAbbrs = {
la = "ls -lahH";
};
plugins = with pkgs.fishPlugins; [
{
name = "tide";
inherit (tide) src;
}
];
};
home.activation.configure-tide = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.fish}/bin/fish -c "tide configure --auto --style=Lean --prompt_colors='16 colors' --show_time=No --lean_prompt_height='Two lines' --prompt_connection=Disconnected --prompt_spacing=Compact --icons='Few icons' --transient=Yes"
'';
}
+24
View File
@@ -0,0 +1,24 @@
{
config,
lib,
pkgs,
...
}:
{
home.packages = with pkgs; [
git-credential-oauth
git-crypt
];
programs.git = {
enable = true;
settings = {
user.name = "Leonhard Kost";
user.email = "leonhard.kost@gmail.com";
credential.helper = [
"cache --timeout 21600"
("oauth" + lib.optionalString (!config.kekleo.graphical) " -device")
];
};
};
}
+88
View File
@@ -0,0 +1,88 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.kekleo.graphical {
home.packages = with pkgs; [ nordzy-cursor-theme ];
programs.waybar.enable = true;
wayland.windowManager.hyprland =
let
# workspaces
# binds $mod/alt + [shift +] {1..9} to [move to] workspace {1..9}
workspaces = builtins.concatLists (
builtins.genList (
i:
let
ws = toString (i + 1);
in
[
"$mod,${ws},workspace,${ws}"
"ALT,${ws},workspace,${ws}"
"$mod SHIFT,${ws},movetoworkspace,${ws}"
"ALTSHIFT,${ws},movetoworkspace,${ws}"
]
) 9
);
in
{
enable = true;
package = pkgs.hyprland;
xwayland.enable = true;
settings = {
env = [
"HYPRCURSOR_THEME,Nordzy-cursors"
"HYPRCURSOR_SIZE,26"
];
monitor = [
",1920x1080@60,0x0,1"
];
"$mod" = "SUPER";
"$launcher" = "rofi -show drun";
bind = [
"ALTSHIFT,Q,killactive,"
"ALT,V,togglefloating,"
"ALT,F,fullscreen,1"
"ALTSHIFT,F,fullscreen,0"
"$mod,Return,exec,kitty"
"$mod,F,exec,firefox"
"$mod,R,exec,$launcher"
"ALT,H,movefocus,l"
"ALT,L,movefocus,r"
"ALT,K,movefocus,u"
"ALT,J,movefocus,d"
"ALTSHIFT,H,movewindow,l"
"ALTSHIFT,L,movewindow,r"
"ALTSHIFT,K,movewindow,u"
"ALTSHIFT,J,movewindow,d"
]
++ workspaces;
windowrule = "bordersize 0, fullscreen:1";
general = {
gaps_in = 2;
gaps_out = 2;
"col.active_border" = "0xff888888";
};
animations.animation = [
"windows,1,4,default"
"border,1,5,default"
"fadeIn,1,5,default"
"workspaces,1,3,default"
];
dwindle.force_split = 2;
cursor.no_warps = true;
};
};
};
}
+22
View File
@@ -0,0 +1,22 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.kekleo.graphical {
programs.kitty = {
enable = true;
themeFile = "tokyo_night_night";
font = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrainsMono NF";
size = 14;
};
keybindings = {
"ctrl+alt+enter" = "launch --cwd=current";
};
};
};
}
+34
View File
@@ -0,0 +1,34 @@
{
config,
lib,
...
}:
{
imports = [
./opts.nix
./keymaps.nix
./plugins
];
options.kekleo.neovim = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable neovim.";
};
config = lib.mkIf config.kekleo.neovim {
programs.nixvim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
colorschemes.tokyonight.enable = true;
clipboard.providers.wl-copy.enable = true;
globals.mapleader = " ";
};
};
}
+42
View File
@@ -0,0 +1,42 @@
{
programs.nixvim.keymaps = [
{
mode = "n";
key = "<Esc>";
action = "<cmd>nohlsearch<CR>";
options.silent = true;
}
{
mode = "n";
key = "<leader>q";
action.__raw = "vim.diagnostic.setloclist";
options.desc = "Open diagnostics quickfix list";
}
{
mode = "n";
key = "<C-h>";
action = "<C-w><C-h>";
options.desc = "Move focus to the left window";
}
{
mode = "n";
key = "<C-l>";
action = "<C-w><C-l>";
options.desc = "Move focus to the right window";
}
{
mode = "n";
key = "<C-k>";
action = "<C-w><C-k>";
options.desc = "Move focus to the upper window";
}
{
mode = "n";
key = "<C-j>";
action = "<C-w><C-j>";
options.desc = "Move focus to the lower window";
}
];
}
+37
View File
@@ -0,0 +1,37 @@
{
programs.nixvim.opts = {
number = true;
relativenumber = true;
showmode = false;
breakindent = true;
undofile = true;
ignorecase = true;
smartcase = true;
signcolumn = "yes";
updatetime = 250;
timeoutlen = 300;
splitright = true;
splitbelow = true;
list = true;
listchars = {
tab = "» ";
trail = "·";
nbsp = "";
};
inccommand = "split";
cursorline = true;
scrolloff = 10;
confirm = true;
};
}
+68
View File
@@ -0,0 +1,68 @@
{
programs.nixvim = {
opts.completeopt = [
"menu"
"menuone"
"noselect"
];
plugins = {
lspkind = {
enable = true;
settings.mode = "symbol";
};
cmp = {
enable = true;
autoEnableSources = true;
settings = {
snippet.expand = "function(args) vim.snippet.expand(args.body) end";
formatting.fields = [
"abbr"
"kind"
"menu"
];
mapping = {
"<C-p>" = "cmp.mapping.select_prev_item()";
"<C-n>" = "cmp.mapping.select_next_item()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-e>" = "cmp.mapping.close()";
"<C-y>" = "cmp.mapping.confirm({ select = true })";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-Space>" = "cmp.mapping.complete()";
"<C-l>" = ''
cmp.mapping(
function()
if vim.snippet.active({ direction = 1 }) then
vim.snippet.jump(1)
end
end,
{'i', 's'}
)
'';
"<C-h>" = ''
cmp.mapping(
function()
if vim.snippet.active({ direction = -1 }) then
vim.snippet.jump(-1)
end
end,
{'i', 's'}
)
'';
};
sources = [
{ name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; }
{ name = "path"; }
];
};
};
};
};
}
@@ -0,0 +1,25 @@
{ pkgs, ... }:
{
imports = [
./cmp.nix
./lsp.nix
./fmt.nix
./treesitter.nix
./telescope.nix
./lualine.nix
./nvim-autopairs.nix
./which-key.nix
];
programs.nixvim = {
plugins = {
lz-n.enable = true;
indent-blankline.enable = true;
web-devicons.enable = true;
};
extraPlugins = with pkgs.vimPlugins; [
vim-sleuth
];
};
}
+52
View File
@@ -0,0 +1,52 @@
{ pkgs, ... }:
{
programs.nixvim = {
opts.formatexpr = "v:lua.require'conform'.formatexpr()";
plugins.conform-nvim = {
enable = true;
lazyLoad.enable = true;
lazyLoad.settings = {
event = "BufWritePre";
cmd = "ConformInfo";
keys = [
{
__unkeyed-1 = "<leader>f";
__unkeyed-2.__raw = ''
function() require 'conform'.format { async = true } end
'';
desc = "Format Buffer";
}
];
};
settings = {
default_format_opts.lsp_format = "fallback";
format_on_save = ''
function(bufnr)
local disable_filetypes = { c = true, cpp = true }
local lsp_format_opt
if disable_filetypes[vim.bo[bufnr].filetype] then
lsp_format_opt = 'never'
else
lsp_format_opt = 'fallback'
end
return {
timeout_ms = 500,
lsp_format = lsp_format_opt,
}
end
'';
formatters_by_ft = {
lua = [ "stylua" ];
nix = [ "nixfmt" ];
};
};
};
extraPackages = with pkgs; [
stylua
nixfmt-rfc-style
];
};
}
+65
View File
@@ -0,0 +1,65 @@
{
programs.nixvim = {
diagnostic.settings = {
severity_sort = true;
float = {
border = "rounded";
source = "if_many";
};
signs.text.__raw = "{
[vim.diagnostic.severity.ERROR] = '󰅚 ',
[vim.diagnostic.severity.WARN] = '󰀪 ',
[vim.diagnostic.severity.INFO] = '󰋽 ',
[vim.diagnostic.severity.HINT] = '󰌶 ',
}";
virtual_text = {
source = "if_many";
spacing = 2;
format.__raw = "
function(diagnostic)
return diagnostic.message
end
";
};
};
plugins = {
lsp = {
enable = true;
keymaps = {
silent = true;
lspBuf = {
"gd" = "definition";
"gD" = "declaration";
"gr" = "references";
"gI" = "implementation";
"<leader>ca" = "code_action";
"<leader>D" = "type_definition";
"<leader>rn" = "rename";
};
};
servers = {
lua_ls.enable = true;
nil_ls.enable = true;
pyright.enable = true;
ts_ls.enable = true;
vue_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = false;
installRustc = false;
};
qmlls = {
enable = true;
cmd = [
"qmlls"
"-E"
];
};
};
};
};
};
}
@@ -0,0 +1,21 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
settings = {
options = {
section_separators = "";
component_separators = "";
};
sections = {
lualine_b = [
{
__unkeyed-1 = "branch";
icon = "";
}
];
lualine_c = [ "filename" ];
lualine_x = [ "filetype" ];
};
};
};
}
@@ -0,0 +1,9 @@
{
programs.nixvim.plugins.nvim-autopairs = {
enable = true;
lazyLoad = {
enable = true;
settings.event = "InsertEnter";
};
};
}
@@ -0,0 +1,46 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
ripgrep
];
programs.nixvim.plugins.telescope = {
enable = true;
extensions.fzf-native.enable = true;
keymaps = {
"<leader>sh" = {
action = "help_tags";
options.desc = "Search Help";
};
"<leader>sf" = {
action = "find_files";
options.desc = "Search Files";
};
"<leader>ss" = {
action = "builtin";
options.desc = "Search Select Telescope";
};
"<leader>sg" = {
action = "live_grep";
options.desc = "Search by Grep";
};
"<leader><leader>" = {
action = "buffers";
options.desc = "Find existing buffers";
};
"<leader>/" = {
action = "current_buffer_fuzzy_find";
options.desc = "Find in current buffer";
};
};
settings.defaults.file_ignore_patterns = [
"^.git/"
"^.mypy_cache/"
"^__pycache__/"
"^output/"
"^data/"
"^node_modules/"
"%.ipynb"
];
};
}
@@ -0,0 +1,17 @@
{ pkgs, ... }:
{
programs.nixvim = {
plugins.treesitter = {
enable = true;
settings = {
auto_install = true;
highlight.enable = true;
indent.enable = true;
};
};
extraPackages = with pkgs; [
gcc
];
};
}
@@ -0,0 +1,9 @@
{
programs.nixvim.plugins.which-key = {
enable = true;
lazyLoad = {
enable = true;
settings.event = "VimEnter";
};
};
}
+44
View File
@@ -0,0 +1,44 @@
{
config,
lib,
...
}:
{
config = lib.mkIf config.kekleo.graphical {
programs.rofi = {
enable = true;
font = "JetBrainsMono Nerd Font 11";
theme = ./tokyonight.rasi;
extraConfig = {
modi = [
"drun"
"window"
"run"
];
icon-theme = "Papirus-Dark";
show-icons = true;
terminal = "kitty";
drun-display-format = "{icon} {name}";
location = 0;
disable-history = false;
sidebar-mode = false;
display-drun = " ";
display-run = " ";
display-window = " ";
kb-row-up = "Up,Control+k";
kb-row-left = "Left,Control+h";
kb-row-right = "Right,Control+l";
kb-row-down = "Down,Control+j";
kb-accept-entry = "Return";
# remove clashing keybinds
kb-remove-to-eol = "";
kb-move-char-back = "Control+b";
kb-remove-char-back = "BackSpace";
kb-move-char-forward = "Control+f";
kb-mode-complete = "Control+o";
};
};
};
}
+136
View File
@@ -0,0 +1,136 @@
/*
* Tokyonight colorscheme (big icons) for rofi
* User: w8ste
*/
// define colors etc.
* {
bg: #24283b;
hv: #9274ca;
primary: #C5C8C6;
ug: #0B2447;
background-color: @bg;
//dark: @bg;
border: 0px;
kl: #7aa2f7;
black: #000000;
transparent: rgba(46,52,64,0);
}
// defines different aspects of the window
window {
width: 700;
/*since line wont work with height, i comment it out
if you rather control the size via height
just comment it out */
//height: 500;
orientation: horizontal;
location: center;
anchor: center;
transparency: "screenshot";
border-color: @transparent;
border: 0px;
border-radius: 6px;
spacing: 0;
children: [ mainbox ];
}
mainbox {
spacing: 0;
children: [ inputbar, message, listview ];
}
inputbar {
color: @kl;
padding: 11px;
border: 3px 3px 2px 3px;
border-color: @primary;
border-radius: 6px 6px 0px 0px;
}
message {
padding: 0;
border-color: @primary;
border: 0px 1px 1px 1px;
}
entry, prompt, case-indicator {
text-font: inherit;
text-color: inherit;
}
entry {
cursor: pointer;
}
prompt {
margin: 0px 5px 0px 0px;
}
listview {
layout: vertical;
//spacing: 5px;
padding: 8px;
lines: 7;
columns: 1;
border: 0px 3px 3px 3px;
border-radius: 0px 0px 6px 6px;
border-color: @primary;
dynamic: false;
}
element {
padding: 2px;
vertical-align: 1;
color: @kl;
font: inherit;
}
element-text {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
}
element selected.normal {
color: @black;
background-color: @hv;
}
element normal active {
background-color: @hv;
color: @black;
}
element-icon {
background-color: inherit;
text-color: inherit;
size: 2.5em;
}
element normal urgent {
background-color: @primary;
}
element selected active {
background: @hv;
foreground: @bg;
}
button {
padding: 6px;
color: @primary;
horizonatal-align: 0.5;
border: 2px 0px 2px 2px;
border-radius: 4px 0px 0px 4px;
border-color: @primary;
}
button selected normal {
border: 2px 0px 2px 2px;
border-color: @primary;
}