From 637d16e3f53f547af17e5f77fdcb584a3634b60a Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Wed, 13 Mar 2024 18:00:41 +0100 Subject: [PATCH] Refactored nvim config; Using master upstram of nixvim --- flake.lock | 61 +++++---- flake.nix | 3 +- home/config-files/hyprland.conf | 2 +- home/modules/home-pkgs.nix | 4 + home/modules/nixvim.nix | 220 ++++++++++++++++++++++++++++---- hosts/lilith/default.nix | 2 +- 6 files changed, 231 insertions(+), 61 deletions(-) diff --git a/flake.lock b/flake.lock index a8161d4..6c49913 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1708939976, - "narHash": "sha256-O5+nFozxz2Vubpdl1YZtPrilcIXPcRAjqNdNE8oCRoA=", + "lastModified": 1710156081, + "narHash": "sha256-4PMY6aumJi5dLFjBzF5O4flKXmadMNq3AGUHKYfchh0=", "owner": "numtide", "repo": "devshell", - "rev": "5ddecd67edbd568ebe0a55905273e56cc82aabe3", + "rev": "bc68b058dc7e6d4d6befc4ec6c60082b6e844b7d", "type": "github" }, "original": { @@ -29,11 +29,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1709784245, - "narHash": "sha256-t1sobS2zj7hD/dZj9aVPipYnskrk+Q7FqAViSqEMLQU=", + "lastModified": 1710329340, + "narHash": "sha256-EL1wI4vyZsT0bUT8t5ZOPS+UrVZ6NKsQtKwxOSmZm6Q=", "owner": "rycee", "repo": "nur-expressions", - "rev": "673c3faea3a5239f4efe545c4649c2b68501dbe1", + "rev": "2587d46d5904de710b56a9f359579a165c38ee55", "type": "gitlab" }, "original": { @@ -114,11 +114,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1709126324, - "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -192,11 +192,11 @@ ] }, "locked": { - "lastModified": 1709764752, - "narHash": "sha256-+lM4J4JoJeiN8V+3WSWndPHj1pJ9Jc1UMikGbXLqCTk=", + "lastModified": 1710329147, + "narHash": "sha256-ExKfXL6PURo5VJ9bNPkOxCNBlRDoPILeCfUrMyJ20i0=", "owner": "nix-community", "repo": "home-manager", - "rev": "cf111d1a849ddfc38e9155be029519b0e2329615", + "rev": "1b74e3679e90fe7ad142bb5f66610a0d92ac0165", "type": "github" }, "original": { @@ -214,11 +214,11 @@ ] }, "locked": { - "lastModified": 1709578243, - "narHash": "sha256-hF96D+c2PBmAFhymMw3z8hou++lqKtZ7IzpFbYeL1/Y=", + "lastModified": 1710062421, + "narHash": "sha256-FiCNRfyUgJOLYIokLiFsfI7B+Zn9HDnOzFR3uVr5qsQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "23ff9821bcaec12981e32049e8687f25f11e5ef3", + "rev": "36f873dfc8e2b6b89936ff3e2b74803d50447e0a", "type": "github" }, "original": { @@ -235,11 +235,11 @@ ] }, "locked": { - "lastModified": 1709554374, - "narHash": "sha256-1yYgwxBzia+QrOaQaZ6YKqGFfiQcSBwYLzd9XRsRLQY=", + "lastModified": 1709771483, + "narHash": "sha256-Hjzu9nCknHLQvhdaRFfCEprH0o15KcaNu1QDr3J88DI=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "daa03606dfb5296a22e842acb02b46c1c4e9f5e7", + "rev": "550340062c16d7ef8c2cc20a3d2b97bcd3c6b6f6", "type": "github" }, "original": { @@ -250,11 +250,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1709410583, - "narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=", + "lastModified": 1710123225, + "narHash": "sha256-j3oWlxRZxB7cFsgEntpH3rosjFHRkAo/dhX9H3OfxtY=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc", + "rev": "ad2fd7b978d5e462048729a6c635c45d3d33c9ba", "type": "github" }, "original": { @@ -282,11 +282,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1709840082, - "narHash": "sha256-IE6KVI305U3Oy2J7Wz+hnllqy1SqUapUUT2BaSEJ2F4=", + "lastModified": 1710329155, + "narHash": "sha256-HvOKJXyu0JJuTGHHHw3gdiXgvWnyDkOyX42Nmnc2fDk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "76716d32209e34054ca9dfb0dd69270713d3a7e3", + "rev": "a6af0d92679222ba704841a6515d9a7e022af6fd", "type": "github" }, "original": { @@ -298,11 +298,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1709703039, - "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", + "lastModified": 1710272261, + "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", + "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", "type": "github" }, "original": { @@ -325,17 +325,16 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1709760463, - "narHash": "sha256-gKP997+xtyWvJXBjnAaiT/Dmk22wo1T/DzkNMDk9GHU=", + "lastModified": 1710283972, + "narHash": "sha256-kkN0CJwykU4XoTDLHG68eEBXyp+GLTp7eJGDVrI7QIU=", "owner": "nix-community", "repo": "nixvim", - "rev": "22b587f3dc5c040eb1916aa2a67868f1918d9d17", + "rev": "c2cd3cb7a13c0677c49f46d55a8c65b50b7d9431", "type": "github" }, "original": { "owner": "nix-community", "repo": "nixvim", - "rev": "22b587f3dc5c040eb1916aa2a67868f1918d9d17", "type": "github" } }, diff --git a/flake.nix b/flake.nix index ba4752d..8f5114a 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,8 @@ inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master"; inputs.nixvim = { # If you are not running an unstable channel of nixpkgs, select the corresponding branch of nixvim. - url = "github:nix-community/nixvim/22b587f3dc5c040eb1916aa2a67868f1918d9d17"; + #url = "github:nix-community/nixvim/22b587f3dc5c040eb1916aa2a67868f1918d9d17"; + url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/home/config-files/hyprland.conf b/home/config-files/hyprland.conf index 96fcd18..aaa9277 100644 --- a/home/config-files/hyprland.conf +++ b/home/config-files/hyprland.conf @@ -36,7 +36,7 @@ input { device { name = at-translated-set-2-keyboard - enabled = false + enabled = true } general { diff --git a/home/modules/home-pkgs.nix b/home/modules/home-pkgs.nix index 4f7b749..7334931 100644 --- a/home/modules/home-pkgs.nix +++ b/home/modules/home-pkgs.nix @@ -31,6 +31,8 @@ nodejs nerdfonts + ipafont + vivaldi vivaldi-ffmpeg-codecs @@ -50,6 +52,8 @@ neovide + ripgrep + yubioath-flutter steam diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix index 9dc15e6..2ef257d 100644 --- a/home/modules/nixvim.nix +++ b/home/modules/nixvim.nix @@ -63,36 +63,45 @@ navigation.enable = true; }; cursorline.enable = true; - nvim-cmp = { + cmp = { enable = true; autoEnableSources = true; - sources = [ - {name = "nvim_lsp";} - {name = "path";} - {name = "buffer";} - {name = "luasnip";} - ]; - snippet.expand = "luasnip"; - - mapping = { - "" = "cmp.mapping.confirm({ select = true })"; - "" = { - action = '' - function(fallback) - local luasnip = require 'luasnip' - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end + settings = { + snippet = { + expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + }; + sources = [ + {name = "nvim_lsp";} + {name = "path";} + {name = "buffer";} + {name = "luasnip";} + ]; + #mapping = { + # __raw = '' + # cmp.mapping.preset.insert({ + # [''] = + # }) + # ''; + #}; + mapping = { + "" = '' + cmp.mapping.confirm({ select = true }) + ''; + "" = '' + function(fallback) + local luasnip = require('luasnip') + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end ''; - modes = ["i" "s"]; }; }; }; @@ -104,13 +113,164 @@ noice.enable = true; notify.enable = true; luasnip.enable = true; + cmp_luasnip.enable = true; neo-tree.enable = true; presence-nvim.enable = true; crates-nvim.enable = true; fidget.enable = true; alpha = { enable = true; - theme = "startify"; + theme = null; + + iconsEnabled = true; + layout = [ + { + type = "padding"; + val = 4; + } + { + type = "text"; + #val = [ + # " config by: " + # " ▒██ ██▒ █████ ▄▄▄█████▓ ▄████▄ " + # " ▒▒ █ █ ▒░▒██▓ ██▒▓ ██▒ ▓▒▒██▀ ▀█ " + # " ░░ █ ░▒██▒ ██░▒ ▓██░ ▒░▒▓█ ▄ " + # " ░ █ █ ▒ ░██ █▀ ░░ ▓██▓ ░ ▒▓▓▄ ▄██▒ " + # " ▒██▒ ▒██▒░▒███▒█▄ ▒██▒ ░ ▒ ▓███▀ ░ " + # " ▒▒ ░ ░▓ ░░░ ▒▒░ ▒ ▒ ░░ ░ ░▒ ▒ ░ " + # " ░░ ░▒ ░ ░ ▒░ ░ ░ ░ ▒ " + # " ░ ░ ░ ░ ░ ░ " + # " ░ ░ ░ ░ ░ " + # " ░ " + # " git@git.sr.ht:xqtc " + #]; + val = [ + " ███████████████ ██████████████████" + " ███████████████ ██ " + " ███████████████ ██████████████████" + " ███████████████ ██ ██" + " ███████████████ ██████████████████" + " ███████████████ █ ██ █ " + " ███████████████ █ ██ █ " + " ███████████████ █ ██ █ " + " ███████████████ " + " ███████████████ ██████████████████" + " ███████████████ ██ ██ " + " ██████████████████████████ ██████████████████" + " ██████████████████████████ ██ ██" + " ██████████████████████████ ██████████████████" + " ██████████████████████████ ██ ██ " + " ██████████████████████████ ██████████████████" + " ██████████████████████████ " + " ██████████████████████████ ▀▀▀▀▀▀▀▀██▀▀▀▀▀▀▀▀" + " ██████████████████████████ ▀▀▀▀▀▀▀▀██▀▀▀▀▀▀▀▀" + " ██████████████████████████ ██████████████████" + " ███████████████▀▀▀▀▀▀▀▀▀▀▀ ██ ██" + " ███████████████ ██████████████████" + " ███████████████ ▄▄▄▄▄▄▄▄██▄▄▄▄▄▄▄▄" + " ████████████████ ▄▄▄▄▄▄▄▄██▄▄▄▄▄▄▄▄" + " █████████████████ " + " ██████████████████ ██████████████████" + " ███████████████████ ██ " + " ████████████████████ ██ " + " █████████████████████ ██ " + " ██████████████████████ ██ " + " ███████████████████████ ██ " + " ████████████████████████ ██████████████████" + ]; + opts = { + position = "center"; + hl = "Type"; + }; + } + { + type = "padding"; + val = 3; + } + { + type = "text"; + # val = [ + # " ███▄ █ ██▓▒██ ██▒ ██▒ █▓ ██▓ ███▄ ▄███▓" + # " ██ ▀█ █ ▓██▒▒▒ █ █ ▒░▓██░ █▒▓██▒▓██▒▀█▀ ██▒" + # "▓██ ▀█ ██▒▒██▒░░ █ ░ ▓██ █▒░▒██▒▓██ ▓██░" + # "▓██▒ ▐▌██▒░██░ ░ █ █ ▒ ▒██ █░░░██░▒██ ▒██ " + # "▒██░ ▓██░░██░▒██▒ ▒██▒ ▒▀█░ ░██░▒██▒ ░██▒" + # "░ ▒░ ▒ ▒ ░▓ ▒▒ ░ ░▓ ░ ░ ▐░ ░▓ ░ ▒░ ░ ░" + # "░ ░░ ░ ▒░ ▒ ░░░ ░▒ ░ ░ ░░ ▒ ░░ ░ ░" + # " ░ ░ ░ ▒ ░ ░ ░ ░░ ▒ ░░ ░ " + # " ░ ░ ░ ░ ░ ░ ░ " + # " ░ " + # ]; + val = [ + "TOHA HEAVY INDUSTRIES" + ]; + opts = { + position = "center"; + hl = "Keyword"; + }; + } + { + type = "padding"; + val = 2; + } + { + type = "group"; + val = [ + { + type = "text"; + val = " To browse files press 'ff'"; + opts = { + position = "center"; + }; + } + ]; + opts = { + position = "center"; + }; + } + { + type = "padding"; + val = 2; + } + { + type = "text"; + val = "uwu"; + opts = { + position = "center"; + hl = "Keyword"; + }; + } + { + type = "padding"; + val = 4; + } + #{ + # type = "text"; + # val = [ + # "      /^>》, -―‐‐<^}" + # "     ./:::/,≠´::::::ヽ." + # "    /::::〃::::/}::丿ハ" + # "   ./:::::i{l|/ ノ/ }::}" + # "   /:::::::瓜イ> ´< ,:ノ" + # "  ./::::::|ノヘ.{、 (_フ_ノノイ_" + # "  |:::::::|/}`ス / /" + # ". |::::::|(_:::つ/ ThinkPad / neovim!" + # ". ̄ ̄ ̄ ̄ ̄ ̄ ̄\/_____/ ̄ ̄ ̄ ̄ ̄" + # ]; + # opts = { + # position = "center"; + # hl = "Type"; + # }; + #} + ]; + opts = { + #noautocmd = true; + + keymap = { + press = ""; + press_queue = ""; + }; + }; }; bufferline.enable = true; }; @@ -121,6 +281,12 @@ options.silent = true; action = "Telescope file_browser"; } + { + mode = "n"; + key = "hh"; + options.silent = true; + action = "Alpha"; + } { mode = "n"; key = "bb"; diff --git a/hosts/lilith/default.nix b/hosts/lilith/default.nix index 3820000..d0387c9 100644 --- a/hosts/lilith/default.nix +++ b/hosts/lilith/default.nix @@ -150,7 +150,7 @@ wdisplays #qemu_full gnomeExtensions.blur-my-shell - surrealdb + #surrealdb zathura ];