hypr eco systems

This commit is contained in:
cnst
2024-07-15 19:40:02 +02:00
parent 7052dc1c10
commit 46aaf625b2
42 changed files with 118 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
{
pkgs,
lib,
config,
inputs,
...
}: let
firefoxFlake = inputs.firefox-nightly.packages.${pkgs.stdenv.hostPlatform.system};
_firefoxNightly = firefoxFlake.firefox-nightly-bin;
_chromium = pkgs.ungoogled-chromium;
# _mullvad = pkgs.mullvad-browser;
in {
home.packages = lib.mkMerge [
(lib.mkIf (pkgs.hostPlatform.system == "x86_64-linux") (
with pkgs; [
# browsers
_firefoxNightly
pkgs.firefox-bin
_chromium
]
))
];
}

View File

@@ -0,0 +1,44 @@
{pkgs, ...}: {
home.packages = with pkgs; [vesktop];
xdg.configFile."vesktop/themes/base16.css".text =
/*
css
*/
''
/**
* @name Material Gruvbox
* @.
* @author Costeer
* @version 1.5.0
* @website https://github.com/Costeer
* @source https://github.com/Costeer/Gruvbox-Material-Themes
*/
@import url(https://mwittrien.github.io/BetterDiscordAddons/Themes/DiscordRecolor/DiscordRecolor.css);
:root {
--accentcolor: 137, 180, 130;
--accentcolor2: 211, 134, 155;
--linkcolor: 125, 174, 163;
--mentioncolor: 211, 134, 155;
--textbrightest: 221, 199, 161;
--textbrighter: 212, 190, 152;
--textbright: 168, 153, 132;
--textdark: 146, 131, 116;
--textdarker: 146, 131, 116;
--textdarkest: 80, 80, 80;
--font: Input Sans Narrow;
--main-font: Input Sans Narrow;
--code-font: Input Mono Compressed;
--backgroundaccent: 80, 73, 69;
--backgroundprimary: 60, 56, 54;
--backgroundsecondary: 50, 48, 47;
--backgroundsecondaryalt: 40, 40, 40;
--backgroundtertiary: 29, 32, 33;
--backgroundfloating: 20, 22, 23;
--settingsicons: 1;
}
'';
}

View File

@@ -0,0 +1,12 @@
{pkgs, ...}: {
home.packages = [
(pkgs.lutris.override {
extraPkgs = p: [
p.wineWowPackages.staging
p.pixman
p.libjpeg
p.gnome.zenity
];
})
];
}

View File

@@ -0,0 +1,8 @@
{
programs.mangohud = {
enable = true;
settings = {
full = true;
};
};
}

View File

@@ -0,0 +1,27 @@
{
services.hypridle = {
enable = true;
importantPrefixes = [
"$lock_cmd = pidof hyprlock || hyprlock"
"$suspend_cmd = pidof steam || systemctl suspend || loginctl suspend"
];
settings = {
general = {
lock_cmd = "$lock_cmd";
before_sleep_cmd = "$lock_cmd";
};
listener = [
{
timeout = 900; # 15mins
on-timeout = "$lock_cmd";
}
{
timeout = 1200; # 20mins
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
}

View File

@@ -0,0 +1,69 @@
{
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
hide_cursor = false;
no_fade_in = true;
};
background = [
{
path = "/src/wallpaper.png";
blur_size = 3;
blur_passes = 2;
}
];
input-field = [
{
monitor = "";
size = "200, 50";
outline_thickness = 2;
dots_size = 0.33;
dots_spacing = 0.15;
dots_center = true;
dots_rounding = -1;
outer_color = "rgba(3B3B3B55)";
inner_color = "rgba(33333311)";
font_color = "rgba(FFFFFFFF)";
fade_on_empty = true;
fade_timeout = 5000;
placeholder_text = "";
hide_input = false;
rounding = -1;
check_color = "rgb(204, 136, 34)";
failed_color = "rgb(204, 34, 34)";
}
];
label = [
{
# Clock
monitor = "";
text = "cmd[update:1000] echo '$TIME'";
shadow_passes = 1;
shadow_boost = 0.5;
color = "rgba(FFFFFFFF)";
font_size = 85;
font_family = "Input Mono";
position = "0, 300";
halign = "center";
valign = "center";
}
{
# Date
monitor = "";
text = "cmd[update:1000] echo '$(date -I)'";
shadow_passes = 1;
shadow_boost = 0.5;
color = "rgba(FFFFFFFF)";
font_size = 25;
font_family = "Input Mono Compressed";
position = "0, 280";
halign = "center";
valign = "center";
}
];
};
};
}

View File

@@ -0,0 +1,17 @@
{
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
splash_offset = 2.0;
preload = ["./src/nix.png" "./src/wallpaper.png"];
wallpaper = [
"DP-3,./src/wallpaper.png"
# "DP-1,/share/wallpapers/cat_pacman.png"
];
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 KiB

View File

@@ -0,0 +1,232 @@
{pkgs, ...}: {
programs.foot = {
enable = true;
package = pkgs.foot;
settings = {
# -*- conf -*-
# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
# title=foot
# locked-title=no
# font=monospace:size=8
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# font-size-adjustment=0.5
# line-height=<font metrics>
# letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# underline-thickness=<font underline thickness>
# box-drawings-uses-font-glyphs=no
# dpi-aware=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
# pad=0x0 # optionally append 'center'
# resize-by-cells=yes
# resize-delay-ms=100
# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is libutempter (Linux)
# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ulog (FreeBSD)
main = {
font = "Input Mono Compressed:size=10";
dpi-aware = "yes";
pad = "3x1";
};
environment = {
# name=value
};
bell = {
urgent = "no";
notify = "no";
visual = "no";
command = "no";
command-focused = "no";
};
scrollback = {
lines = "100";
# multiplier=3.0
# indicator-position=relative
# indicator-format=""
};
url = {
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
};
cursor = {
style = "block";
# color=<inverse foreground/background>
blink = "no";
# blink-rate=500
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
};
mouse = {
hide-when-typing = "no";
# alternate-scroll-mode=yes
};
touch = {
# long-press-delay=400
};
colors = {
alpha = "0.9";
background = "282828";
foreground = "ebdbb2";
regular0 = "282828";
regular1 = "cc241d";
regular2 = "98971a";
regular3 = "d79921";
regular4 = "458588";
regular5 = "b16286";
regular6 = "689d6a";
regular7 = "a89984";
bright0 = "928374";
bright1 = "fb4934";
bright2 = "b8bb26";
bright3 = "fabd2f";
bright4 = "83a598";
bright5 = "d3869b";
bright6 = "8ec07c";
bright7 = "ebdbb2";
};
csd = {
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-maximized=no
# double-click-to-maximize=yes
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
};
key-bindings = {
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard
# show-urls-launch=Control+Shift+o
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=Control+Shift+u
# noop=none
};
search-bindings = {
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-char=Shift+Right
# extend-to-word-boundary=Control+w Control+Shift+Right
# extend-to-next-whitespace=Control+Shift+w
# extend-line-down=Shift+Down
# extend-backward-char=Shift+Left
# extend-backward-to-word-boundary=Control+Shift+Left
# extend-backward-to-next-whitespace=none
# extend-line-up=Shift+Up
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
# quit=none
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
};
url-bindings = {
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
};
text-bindings = {
# \x03=Mod4+c # Map Super+c -> Ctrl+c
};
mouse-bindings = {
# scrollback-up-mouse=BTN_BACK
# scrollback-down-mouse=BTN_FORWARD
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-quote = BTN_LEFT-3
# select-row=BTN_LEFT-4
};
# vim: ft=dosini
};
};
}

View File

@@ -0,0 +1,42 @@
{
programs.kitty = {
enable = true;
theme = "Gruvbox Material Dark Soft";
settings = {
enable_audio_bell = false;
open_url_with = "firefox-nightly";
font_family = "Input Mono Extra Light";
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
font_size = "11.0";
cursor_blink_interval = 0;
cursor_beam_thickness = 3;
copy_on_select = true;
background_opacity = "0.95";
background_blur = "32";
window_padding_width = 3;
tab_bar_min_tabs = 1;
tab_bar_edge = "bottom";
tab_bar_style = "separator";
tab_bar_margin_width = "0.0";
tab_bar_margin_height = "0.0 0.0";
active_tab_font_style = "bold";
tab_title_max_length = 30;
# colors
active_tab_foreground = "#32302f";
active_tab_background = "#8bba7f";
inactive_tab_foreground = "#665C54";
inactive_tab_background = "#6f8352";
tab_bar_background = "#504945";
};
extraConfig = ''
kitty_mod ctrl
map kitty_mod+q close_tab
map ctrl+shift+c copy_to_clipboard
map ctrl+shift+v paste_from_clipboard
tab_separator " | "
tab_title_template "{fmt.fg.tab}{title[:30]}"
'';
};
}

View File

@@ -0,0 +1,31 @@
{
programs.nixvim.autoCmd = [
# Open help in a vertical split
{
event = "FileType";
pattern = "help";
command = "wincmd L";
}
# Enable spellcheck for some filetypes
{
event = "FileType";
pattern = [
"tex"
"latex"
"markdown"
];
command = "setlocal spell spelllang=en,se";
}
{
event = "TextYankPost";
desc = "Highlight when yanking (copying) text";
# group = "vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true })";
callback = {
__raw = "function()
vim.highlight.on_yank()
end";
};
}
];
}

View File

@@ -0,0 +1,53 @@
{
programs.nixvim = {
opts.completeopt = ["menu" "menuone" "noselect"];
plugins = {
luasnip.enable = true;
lspkind = {
enable = true;
cmp = {
enable = true;
menu = {
nvim_lsp = "[LSP]";
nvim_lua = "[api]";
path = "[path]";
luasnip = "[snip]";
buffer = "[buffer]";
};
};
};
cmp = {
enable = true;
settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = true })";
};
sources = [
{name = "path";}
{name = "nvim_lsp";}
{name = "luasnip";}
{
name = "buffer";
# Words from other open buffers can also be suggested.
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
];
};
};
};
};
}

View File

@@ -0,0 +1,23 @@
{inputs, ...}: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./autocommands.nix
./completion.nix
./keymappings.nix
./options.nix
./plugins
./todo.nix
];
home.shellAliases.v = "nvim";
programs.nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
luaLoader.enable = true;
};
}

View File

@@ -0,0 +1,94 @@
{
config,
lib,
...
}: {
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = let
normal =
lib.mapAttrsToList
(key: action: {
mode = "n";
inherit action key;
})
{
# "<C-c>" = "<cmd> %y+ <CR>";
"<C-v>" = "p";
"<C-a>" = "ggVG";
"<Space>" = "<NOP>";
# Esc to clear search results
"<esc>" = ":noh<CR>";
# fix Y behaviour
Y = "y$";
# back and fourth between the two most recent files
"<C-c>" = ":b#<CR>";
# close by Ctrl+x
"<C-x>" = ":close<CR>";
# save by Space+s or Ctrl+s
"<leader>s" = ":w<CR>";
"<C-s>" = ":w<CR>";
# navigate to left/right window
"<leader>h" = "<C-w>h";
"<leader>l" = "<C-w>l";
# Press 'H', 'L' to jump to start/end of a line (first/last character)
L = "$";
H = "^";
# resize with arrows
"<C-Up>" = ":resize -2<CR>";
"<C-Down>" = ":resize +2<CR>";
"<C-Left>" = ":vertical resize +2<CR>";
"<C-Right>" = ":vertical resize -2<CR>";
# move current line up/down
# M = Alt key
"<M-k>" = ":move-2<CR>";
"<M-j>" = ":move+<CR>";
"<leader>rp" = ":!remi push<CR>";
};
visual =
lib.mapAttrsToList
(key: action: {
mode = "v";
inherit action key;
})
{
"<C-c>" = "y";
# better indenting
">" = ">gv";
"<" = "<gv";
"<TAB>" = ">gv";
"<S-TAB>" = "<gv";
# move selected line / block of text in visual mode
"K" = ":m '<-2<CR>gv=gv";
"J" = ":m '>+1<CR>gv=gv";
};
insert =
lib.mapAttrsToList
(key: action: {
mode = "i";
inherit action key;
})
{
"<C-v>" = "<esc>p";
};
in
config.nixvim.helpers.keymaps.mkKeymaps
{options.silent = true;}
(normal ++ visual ++ insert);
};
}

View File

@@ -0,0 +1,72 @@
{
programs.nixvim = {
globals = {
# Disable useless providers
loaded_ruby_provider = 0; # Ruby
loaded_perl_provider = 0; # Perl
loaded_python_provider = 0; # Python 2
};
clipboard = {
# Use system clipboard
register = "unnamedplus";
providers.wl-copy.enable = true;
};
opts = {
updatetime = 100; # Faster completion
# Line numbers
relativenumber = false; # Relative line numbers
number = true; # Display the absolute line number of the current line
hidden = true; # Keep closed buffer open in the background
showmode = false;
mouse = "a"; # Enable mouse control
mousemodel = "popup"; # Mouse right-click extends the current selection
splitbelow = true; # A new window is put below the current one
splitright = true; # A new window is put right of the current one
list = true;
listchars = {
tab = " ";
trail = "·";
nbsp = "";
extends = "";
precedes = "";
};
swapfile = false; # Disable the swap file
modeline = true; # Tags such as 'vim:ft=sh'
modelines = 100; # Sets the type of modelines
undofile = true; # Automatically save and restore undo history
incsearch = true; # Incremental search: show match for partly typed search command
inccommand = "split"; # Search and replace: preview changes in quickfix list
ignorecase = true; # When the search query is lower-case, match both lower and upper-case
# patterns
smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper
# case characters
scrolloff = 4; # Number of screen lines to show around the cursor
cursorline = true; # Highlight the screen line of the cursor
cursorcolumn = false; # Highlight the screen column of the cursor
signcolumn = "yes"; # Whether to show the signcolumn
colorcolumn = ""; # Columns to highlight
laststatus = 3; # When to use a status line for the last window
fileencoding = "utf-8"; # File-content encoding for the current buffer
# termguicolors = true; # Enables 24-bit RGB color in the |TUI|
spell = false; # Highlight spelling mistakes (local to window)
wrap = false; # Prevent text from wrapping
# Tab options
tabstop = 4; # Number of spaces a <Tab> in the text stands for (local to buffer)
shiftwidth = 4; # Number of spaces used for each step of (auto)indent (local to buffer)
expandtab = true; # Expand <Tab> to spaces in Insert mode (local to buffer)
autoindent = true; # Do clever autoindenting
textwidth = 0; # Maximum width of text that is being inserted. A longer line will be
# broken after white space to get this width.
# Folding
foldlevel = 99; # Folds with a level higher than this number will be closed
};
};
}

View File

@@ -0,0 +1,10 @@
{
programs.nixvim.plugins.barbar = {
enable = true;
keymaps = {
next.key = "<TAB>";
previous.key = "<S-TAB>";
close.key = "<C-w>";
};
};
}

View File

@@ -0,0 +1,10 @@
{
programs.nixvim.plugins.comment = {
enable = true;
settings = {
opleader.line = "<C-b>";
toggler.line = "<C-b>";
};
};
}

View File

@@ -0,0 +1,24 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
liquidsoap = [ "liquidsoap-prettier" ];
html = [ [ "prettierd" "prettier" ] ];
css = [ [ "prettierd" "prettier" ] ];
javascript = [ [ "prettierd" "prettier" ] ];
javascriptreact = [ [ "prettierd" "prettier" ] ];
typescript = [ [ "prettierd" "prettier" ] ];
typescriptreact = [ [ "prettierd" "prettier" ] ];
python = [ "black" ];
lua = [ "stylua" ];
nix = [ "alejandra" ];
markdown = [ [ "prettierd" "prettier" ] ];
yaml = [ "yamllint" "yamlfmt" ];
};
};
}

View File

@@ -0,0 +1,59 @@
{pkgs, ...}: {
imports = [
./barbar.nix
./comment.nix
./efm.nix
# ./floaterm.nix
# ./harpoon.nix
./lsp.nix
./lualine.nix
./markdown-preview.nix
./neo-tree.nix
./startify.nix
./tagbar.nix
./telescope.nix
./treesitter.nix
# ./vimtex.nix
./nonels.nix
./conform.nix
# ./yanky.nix
];
programs.nixvim = {
extraPlugins = [pkgs.vimPlugins.gruvbox-material];
colorscheme = "gruvbox-material";
plugins = {
gitsigns = {
enable = true;
settings.signs = {
add.text = "+";
change.text = "~";
};
};
nvim-autopairs.enable = true;
nvim-colorizer = {
enable = true;
userDefaultOptions.names = false;
};
oil.enable = true;
trim = {
enable = true;
settings = {
highlight = false;
ft_blocklist = [
"checkhealth"
"floaterm"
"lspinfo"
"neo-tree"
"TelescopePrompt"
];
};
};
};
};
}

View File

@@ -0,0 +1,22 @@
{
programs.nixvim.plugins = {
lsp.servers.efm = {
enable = true;
extraOptions.init_options = {
documentFormatting = true;
documentRangeFormatting = true;
hover = true;
documentSymbol = true;
codeAction = true;
completion = true;
};
};
lsp-format = {
enable = true;
lspServersToEnable = ["efm"];
};
efmls-configs.enable = true;
};
}

View File

@@ -0,0 +1,12 @@
{
programs.nixvim.plugins.floaterm = {
enable = true;
width = 0.8;
height = 0.8;
title = "";
keymaps.toggle = "<leader>,";
};
}

View File

@@ -0,0 +1,20 @@
{
programs.nixvim = {
plugins.harpoon = {
enable = true;
keymapsSilent = true;
keymaps = {
addFile = "<leader>a";
toggleQuickMenu = "<C-e>";
navFile = {
"1" = "<C-j>";
"2" = "<C-k>";
"3" = "<C-l>";
"4" = "<C-m>";
};
};
};
};
}

View File

@@ -0,0 +1,84 @@
{
programs.nixvim = {
plugins = {
lsp = {
enable = true;
keymaps = {
silent = true;
diagnostic = {
# Navigate in diagnostics
"<leader>k" = "goto_prev";
"<leader>j" = "goto_next";
};
lspBuf = {
gd = "definition";
gD = "references";
gt = "type_definition";
gi = "implementation";
K = "hover";
"<F2>" = "rename";
};
};
# Language server
servers = {
# Average webdev LSPs
cssls.enable = true; # CSS
tailwindcss.enable = true; # TailwindCSS
html.enable = true; # HTML
astro.enable = true; # AstroJS
phpactor.enable = true; # PHP
svelte.enable = false; # Svelte
vuels.enable = false; # Vue
# Python
pyright.enable = true;
# Markdown
marksman.enable = true;
# Nix
nil-ls.enable = true;
# Docker
dockerls.enable = true;
# Bash
bashls.enable = true;
# C/C++
clangd.enable = true;
# C#
csharp-ls.enable = true;
# Lua
lua-ls = {
enable = true;
settings.telemetry.enable = false;
settings.diagnostics = {
globals = ["vim"];
};
};
tsserver = {
enable = false; # TS/JS
};
# Rust
rust-analyzer = {
enable = true;
installRustc = true;
installCargo = true;
settings = {
checkOnSave = true;
check = {
command = "clippy";
};
};
};
};
};
};
};
}

View File

@@ -0,0 +1,47 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
theme = "gruvbox-material";
globalstatus = true;
# +-------------------------------------------------+
# | A | B | C X | Y | Z |
# +-------------------------------------------------+
sections = {
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = [
"diagnostics"
# Show active language server
{
name.__raw = ''
function()
local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
'';
icon = "";
color.fg = "#ffffff";
}
"encoding"
"fileformat"
"filetype"
];
};
};
}

View File

@@ -0,0 +1,20 @@
{
programs.nixvim = {
plugins.markdown-preview = {
enable = true;
settings = {
auto_close = false;
theme = "dark";
};
};
files."after/ftplugin/markdown.lua".keymaps = [
{
mode = "n";
key = "<leader>m";
action = ":MarkdownPreview<cr>";
}
];
};
}

View File

@@ -0,0 +1,22 @@
{
programs.nixvim = {
keymaps = [
{
mode = "n";
key = "<leader>n";
action = ":Neotree action=focus reveal toggle<CR>";
options.silent = true;
}
];
plugins.neo-tree = {
enable = true;
closeIfLastWindow = true;
window = {
width = 30;
autoExpandWidth = true;
};
};
};
}

View File

@@ -0,0 +1,44 @@
{
programs.nixvim.plugins.none-ls = {
enable = true;
settings = {
cmd = ["bash -c nvim"];
debug = true;
};
sources = {
code_actions = {
statix.enable = true;
gitsigns.enable = true;
};
diagnostics = {
statix.enable = true;
deadnix.enable = true;
pylint.enable = true;
checkstyle.enable = true;
};
formatting = {
alejandra.enable = true;
stylua.enable = true;
shfmt.enable = true;
nixpkgs_fmt.enable = true;
google_java_format.enable = false;
prettier = {
enable = true;
disableTsServerFormatter = true;
};
black = {
enable = true;
withArgs = ''
{
extra_args = { "--fast" },
}
'';
};
};
completion = {
luasnip.enable = true;
spell.enable = true;
};
};
};
}

View File

@@ -0,0 +1,32 @@
{
programs.nixvim.plugins.startify = {
enable = true;
settings = {
custom_header = [
""
" "
" "
" "
" "
" "
" "
];
# When opening a file or bookmark, change to its directory.
change_to_dir = false;
# By default, the fortune header uses ASCII characters, because they work for everyone.
# If you set this option to 1 and your 'encoding' is "utf-8", Unicode box-drawing characters will
# be used instead.
use_unicode = true;
lists = [{type = "dir";}];
files_number = 30;
skiplist = [
"flake.lock"
];
};
};
}

View File

@@ -0,0 +1,17 @@
{
programs.nixvim = {
plugins.tagbar = {
enable = true;
settings.width = 50;
};
keymaps = [
{
mode = "n";
key = "<C-g>";
action = ":TagbarToggle<cr>";
options.silent = true;
}
];
};
}

View File

@@ -0,0 +1,33 @@
{
programs.nixvim = {
plugins.telescope = {
enable = true;
keymaps = {
# Find files using Telescope command-line sugar.
"<leader>ff" = "find_files";
"<leader>fg" = "live_grep";
"<leader>b" = "buffers";
"<leader>fh" = "help_tags";
"<leader>fd" = "diagnostics";
# FZF like bindings
"<C-p>" = "git_files";
"<leader>p" = "oldfiles";
"<C-f>" = "live_grep";
};
settings.defaults = {
file_ignore_patterns = [
"^.git/"
"^.mypy_cache/"
"^__pycache__/"
"^output/"
"^data/"
"%.ipynb"
];
set_env.COLORTERM = "truecolor";
};
};
};
}

View File

@@ -0,0 +1,26 @@
{
programs.nixvim.plugins = {
treesitter = {
enable = true;
nixvimInjections = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
folding = true;
};
treesitter-refactor = {
enable = true;
highlightDefinitions = {
enable = true;
# Set to false if you have an `updatetime` of ~100.
clearOnCursorMove = false;
};
};
hmts.enable = true;
};
}

View File

@@ -0,0 +1,77 @@
{
programs.nixvim = {
plugins.vimtex = {
enable = true;
settings = {
view_method = "zathura";
quickfix_enabled = true;
quickfix_open_on_warning = false;
# Ignore undesired errors and warnings
quickfix_ignore_filters = [
"Underfull"
"Overfull"
"specifier changed to"
"Token not allowed in a PDF string"
];
# TOC settings
toc_config = {
name = "TOC";
layers = ["content" "todo"];
resize = true;
split_width = 50;
todo_sorted = false;
show_help = true;
show_numbers = true;
mode = 2;
};
};
};
files."after/ftplugin/tex.lua".keymaps = [
{
mode = "n";
key = "m";
action = ":VimtexView<cr>";
}
];
autoCmd = [
{
event = ["BufEnter" "BufWinEnter"];
pattern = "*.tex";
command = "set filetype=tex \"| VimtexTocOpen";
}
# Folding
{
event = "FileType";
pattern = ["tex" "latex"];
callback.__raw = ''
function ()
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
vim.o.foldtext = 'vimtex#fold#text()'
end
'';
}
# Compile on initialization
{
event = "User";
pattern = "VimtexEventInitPost";
callback = "vimtex#compiler#compile";
}
# Cleanup on exit
{
event = "User";
pattern = "VimtexEventQuit";
command = "call vimtex#compiler#clean(0)";
}
];
};
}

View File

@@ -0,0 +1,5 @@
{
programs.nixvim.plugins.yanky = {
enable = true;
};
}

View File

@@ -0,0 +1,26 @@
{
programs.nixvim = {
highlight.Todo = {
fg = "Blue";
bg = "Yellow";
};
match.TODO = "TODO";
keymaps = [
{
mode = "n";
key = "<C-t>";
action.__raw = ''
function()
require('telescope.builtin').live_grep({
default_text="TODO",
initial_mode="normal"
})
end
'';
options.silent = true;
}
];
};
}

View File

@@ -0,0 +1,9 @@
{
programs.wezterm = {
enable = true;
enableZshIntegration = true;
# extraConfig = ''
# config.color_scheme = "Gruvbox Material (Gogh)"
# '';
};
}

View File

@@ -0,0 +1,77 @@
{
programs.zellij = {
enable = true;
enableZshIntegration = false;
};
home.shellAliases = {
zr = "zellij run --";
zrf = "zellij run --floating --";
ze = "zellij edit";
zef = "zellij edit --floating";
};
xdg.configFile."zellij/config.kdl".text = ''
default_layout "compact"
mouse_mode true
copy_on_select true
copy_command "wl-copy"
simplified_ui false
scrollback_editor "/home/cnst/.nix-profile/bin/nvim"
pane_frames true
on_force_close "detach"
ui {
pane_frames {
rounded_corners false
}
}
keybinds {
normal {
bind "Alt m" {
LaunchPlugin "file:~/.config/zellij/plugins/monocle.wasm" {
in_place true
kiosk true
};
SwitchToMode "Normal"
}
bind "Ctrl f" {
LaunchOrFocusPlugin "file:~/.config/zellij/plugins/monocle.wasm" {
floating true
}
SwitchToMode "Normal"
}
bind "Alt 1" { GoToTab 1;}
bind "Alt 2" { GoToTab 2;}
bind "Alt 3" { GoToTab 3;}
bind "Alt 4" { GoToTab 4;}
}
shared_except "locked" {
bind "Ctrl y" {
LaunchOrFocusPlugin "file:~/.config/zellij/plugins/room.wasm" {
floating true
ignore_case true
}
}
}
unbind "Ctrl b" "Ctrl h" "Ctrl g" "Alt j"
}
themes {
gruvbox-dark {
bg "#282828"
fg "#D5C4A1"
black "#3C3836"
red "#CC241D"
green "#98971A"
yellow "#D79921"
blue "#458588"
magenta "#B16286"
cyan "#689D6A"
white "#FBF1C7"
orange "#D65D0E"
}
}
'';
}