nixvim: some neovim configs

This commit is contained in:
2005 2024-08-29 18:25:03 +02:00
parent e4682efe24
commit 1929563b9a
14 changed files with 196 additions and 151 deletions

View file

@ -3,5 +3,6 @@
environment.systemPackages = with pkgs; [
#krita
gimp
figma-linux
];
}

View file

@ -1,8 +1,11 @@
{ pkgs, ... }: {
networking.firewall = {
#extraCommands = "iptables -I FORWARD default";
enable = true;
allowedUDPPorts = [
34197 #factorio
];
allowedTCPPorts = [
25565 # mc
];
};
}

View file

@ -3,8 +3,6 @@ let
scripts = "~/.config/scripts";
in
{
home-manager.users.grape.xsession.windowManager.i3 = {
enable = true;
config = {
@ -18,7 +16,7 @@ in
command = "nitrogen --set-zoom-fill /home/grape/dotfiles/bg.jpg";
}
{
command = "picom -b --experimental-backends";
command = "picom -b";
}
{
command = "polybar default";
@ -49,6 +47,7 @@ in
};
keybindings =
lib.mkOptionDefault
{
@ -62,6 +61,7 @@ in
"mod4+r" = "exec firefox";
"mod4+m" = "exec feishin";
"mod4+p" = "exec keepassxc";
"mod4+g" = "exec alacritty --command btop";
# power off
@ -77,21 +77,11 @@ in
"mod4+a" = "exec ${scripts}/start_replay.sh";
"mod4+x" = "exec ${scripts}/stop_replay.sh";
# timewarrior
"mod4+h" = "exec ${scripts}/timew_start.sh";
"mod4+j" = "exec timew stop";
"mod4+k" = "exec timew cancel";
"mod4+g" = "exec timew continue";
# picom
"mod4+o" = "exec ${scripts}/picom_opacity_toggle.sh"; # toggle opacity (some games have it by default due to incorrect configuration i cannot find )
"mod4+o" = "exec ${scripts}/picom_opacity_toggle.sh";
# screenshot
# shit needs work
"Print" = "exec scrot '%Y-%m-%d_%H-%M-%S.png' -e 'mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/$f'";
"mod4+Print" = "exec scrot '%Y-%m-%d_%H-%M-%S.png' -e -u 'mv $f ~/Pictures/screenshots && xclip -selection clipboard -t image/png -i ~/Pictures/screenshots/$f'";
# select window to screenshot then saves it to /home/pictures/screenshots/date+random.png and copies to clipboard
"Shift+Print" = ''exec "NUM=$(echo $RANDOM) maim -s $HOME/Pictures/screenshots/$(date +%Y%m%d_%H%M)$NUM.png ; cat $HOME/Pictures/screenshots/$(date +%Y%m%d_%H%M)$NUM.png | xclip -selection clipboard -t image/png"'';
# sticky window
@ -101,7 +91,6 @@ in
# Volume adjustment for current player
"shift+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl volume 0.1+";
"shift+XF86AudioLowerVolume" = "exec --no-startup-id playerctl volume 0.1-";
# seeking for current player
"Control+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl position 10+";
"Control+XF86AudioLowerVolume" = "exec --no-startup-id playerctl position 10-";

View file

@ -14,6 +14,7 @@
:logseq-banners-plugin {:version "v3.4.11", :repo "yoyurec/logseq-banners-plugin", :effect true, :theme false}
:logseq-plugin-automatic-url-title {:version "v1.1.0", :repo "0x7b1/logseq-plugin-automatic-url-title", :effect true, :theme false}
:logseq-bionic-speedreader {:version "1.0.1", :repo "sawhney17/logseq-bionic-speedreader", :effect true, :theme false}
:logseq-drawio-plugin {:version "v1.7.0", :repo "lee88688/logseq-drawio-plugin", :effect true, :theme false}
}
'';
};

View file

@ -1,8 +1,8 @@
{ pkgs, ... }: {
services.prometheus.exporters.node = {
enable = false;
enable = true;
port = 9001;
openFirewall = true;
listenAddress = "32.54.31.0";
listenAddress = "0.0.0.0";
};
}

View file

@ -3,13 +3,6 @@
enable = true;
#TODO floaterm
# test tool
plugins.neotest = {
enable = true;
};
# TODO nvim-lspconfig
# a snippet engine
plugins.luasnip = {
enable = true;
@ -20,6 +13,161 @@
# enable = true;
#};
plugins.none-ls = {
enable = 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;
};
};
completion = {
luasnip.enable = true;
spell.enable = true;
};
};
};
plugins.lsp =
{
enable = true;
servers = {
# Average webdev LSPs
tsserver.enable = true; # TS/JS
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
pyright.enable = true; # Python
marksman.enable = true; # Markdown
nil-ls.enable = true; # Nix
dockerls.enable = true; # Docker
bashls.enable = true; # Bash
clangd.enable = true; # C/C++
csharp-ls.enable = true; # C#
yamlls.enable = true; # YAML
lua-ls = {
# Lua
enable = true;
settings.telemetry.enable = false;
};
# Rust
rust-analyzer = {
enable = true;
installRustc = false; # disabled so devshells work
installCargo = false; # disabled so devsellsh work
};
};
};
# Highlight word under cursor
plugins.illuminate = {
enable = true;
underCursor = false;
filetypesDenylist = [
"Outline"
"TelescopePrompt"
"alpha"
"harpoon"
"reason"
];
};
# Dashboard
plugins.alpha = {
enable = true;
theme = "dashboard";
iconsEnabled = true;
};
plugins.cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = { ghost_text = true; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = { expand = "luasnip"; };
formatting = { fields = [ "kind" "abbr" "menu" ]; };
sources = [
{ name = "nvim_lsp"; }
{ name = "emoji"; }
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
# { name = "copilot"; } # enable/disable copilot
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
window = {
completion = { border = "solid"; };
documentation = { border = "solid"; };
};
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};
};
};
plugins.cmp-nvim-lsp = {
enable = true; # LSP
};
plugins.cmp-buffer = {
enable = true;
};
plugins.cmp-path = {
enable = true; # file system paths
};
plugins.cmp_luasnip = {
enable = true; # snippets
};
# TODO gen.nvim not in nixvim
@ -29,6 +177,7 @@
};
# todo-comments
plugins.todo-comments.enable = true;
# TODO feline-nvim and theme for it
@ -56,28 +205,17 @@
enable = true;
};
# status bar
plugins.lualine = {
enable = true;
};
# a cool summary searcher
plugins.navbuddy.enable = true;
# language server
plugins.lsp = {
enable = true;
servers.rust-analyzer = {
enable = false;
# for devshells
installRustc = false;
installCargo = false;
};
};
# a completion engine using LSP
# TODO language detection
plugins.coq-nvim = {
enable = true;
installArtifacts = true;
settings.completion.always = true;
# TODO start with nvim
};
# languages
plugins.rustaceanvim.enable = true;
@ -101,8 +239,8 @@
globals.mapleader = " ";
# TODO shades of purple colorscheme
extraPlugins = [ pkgs.vimPlugins.gruvbox ];
colorscheme = "gruvbox";
#extraPlugins = [ pkgs.vimPlugins.gruvbox ];
#colorscheme = "gruvbox";
# extraPlugins = [
# pkgs.vimUtils.buildVimPlugin
# {

View file

@ -6,50 +6,12 @@
vSync = false; # disable vsync to reduce input delay
extraArgs = [ "-b" "--experimental-backends" ]; # enable deamon mode and experimental backends for blur
# idk what package is missing by 24.05 so i included all of them
package =
(pkgs.picom.overrideAttrs (oldAttrs: rec {
src = pkgs.fetchFromGitHub {
owner = "pijulius";
repo = "picom";
rev = "da21aa8ef70f9796bc8609fb495c3a1e02df93f9";
hash = "sha256-rxGWAot+6FnXKjNZkMl1uHHHEMVSxm36G3VoV1vSXLA=";
};
buildInputs = with pkgs; [
dbus
libconfig
libdrm
libev
libGL
xorg.libX11
xorg.libxcb
libxdg_basedir
xorg.libXext
xorg.libXinerama
libxml2
libxslt
pcre
pixman
xorg.xcbutilimage
xorg.xcbutilrenderutil
xorg.xorgproto
];
nativeBuildInputs = with pkgs; [
asciidoc
docbook_xml_dtd_45
docbook_xsl
makeWrapper
meson
ninja
pkg-config
uthash
];
}));
settings = {
# Blurring
blur-method = "dual_kawase";
blur-size = 12;
blur-strength = 5;
blur-strength = 9;
blur-background = true;
blur-kern = "3x3box";
@ -69,7 +31,7 @@
"90:class_g *= 'jamesdsp'"
"90:class_g *= 'polybar'"
"80:class_g *= 'codium'"
"80:class_g *= 'rofi'"
"80:class_g *= 'Rofi'"
"80:class_g *= 'lutris'"
"80:class_g *= 'Mumble'"
"80:class_g *= 'Feishin'"
@ -81,30 +43,13 @@
# rounding
corner-radius = 15;
round-borders = 1;
use-damage = false;
inactive-opacity = 1.0;
frame-opacity = 1.0;
inactive-opacity-override = false;
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
animations = true;
animation-for-open-window = "squeeze";
animation-for-transient-window = "zoom";
animation-for-unmap-window = "squeeze";
animation-for-workspace-switch-in = "zoom";
animation-for-workspace-switch-out = "auto";
animation-stiffness = 500;
animation-dampening = 40;
animation-window-mass = 1;
animation-delta = 7;
animation-force-steps = true;
};
};
}

View file

@ -32,12 +32,6 @@ in
# TODO include labels right into format for each module instea dof having a different module
"module/battery-label" = {
type = "custom/text";
label = "BAT ";
label-foreground = "${colors.seperatorColor}";
};
"module/fs-label-system" = {
type = "custom/text";
label = "SYS ";
@ -63,6 +57,7 @@ in
warn-temperature = 85;
label-warn-foreground = "${colors.warn}";
label-foreground = "${colors.fg}";
label-background = "${colors.bg}";
thermal-zone = 0;
zone-type = "x86_pkg_temp";
hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input";
@ -104,21 +99,6 @@ in
};
"module/audio" = {
type = "internal/alsa";
use-ui-max = false;
label-volume = "%percentage%%";
label-muted = "muted";
label-muted-foreground = "${colors.altfg}";
};
"module/music" = {
type = "custom/script";
interval = ".5";
exec = "~/.config/scripts/music.sh";
format = "<label>";
};
"fs-base" = {
type = "internal/fs";
label-unmounted = "?";

View file

@ -12,7 +12,6 @@
./system/essentials.nix
./system/shell.nix
./system/remap.nix
./system/cursor.nix
./system/ssd.nix
# rice and other usefull apps
@ -67,6 +66,7 @@
#./configs/builders.nix
./configs/element.nix
./configs/nvim.nix
./configs/node_exporter.nix
# terminal
#./configs/st.nix # too minimal, most things dont work without a million tweaks

View file

@ -1,14 +1,11 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
rofi
#rofi-calc
btop
#polybar
nitrogen
ranger
neofetch
#peaclock
cava
bluetuith
@ -20,7 +17,6 @@
# multimedia
feh
mpv
neovim
#animated bg
#(pkgs.callPackage ./apps/wallpepper/default.nix { })
@ -29,24 +25,27 @@
filezilla
# screen sharing
obs-studio
qpwgraph
#obs-studio
#qpwgraph
# work
#figma-linux
#kdenlive
kdenlive
#ffmpeg
#video-trimmer
peek
#peek
# for replay
xdotool
jq
qbittorrent
#qbittorrent
#librewolf
#gimp
# remote desktop
#rustdesk
];
fonts.packages = with pkgs; [
@ -54,9 +53,4 @@
];
home-manager.backupFileExtension = "backup";
}

View file

@ -3,7 +3,7 @@
environment.systemPackages = with pkgs;[
# minecraft
#prismlauncher
prismlauncher
heroic
(lutris.override {
extraPkgs = pkgs: [
@ -26,7 +26,7 @@
#'';
# enabling java for mc
#programs.java = { enable = true; package = pkgs.jdk17; };
programs.java = { enable = true; package = pkgs.jdk17; };
# steam
# To add another drive:

View file

@ -1,8 +0,0 @@
{ pkgs, ... }: {
home-manager.users.grape.home.pointerCursor = {
name = "oreo-cursors-plus";
package = pkgs.oreo-cursors-plus;
gtk.enable = true;
size = 16;
};
}

View file

@ -3,6 +3,7 @@
services.input-remapper.enable = true;
services.input-remapper.serviceWantedBy = [
"multi-user.target"
"graphical.target"
];
environment.systemPackages = [
pkgs.input-remapper

View file

@ -45,6 +45,7 @@
initExtra = ''
PROMPT="[%M] %~ "
'';
sessionVariables = {