From 576b955023aad61aaaccf0068f1a7011fd19ca69 Mon Sep 17 00:00:00 2001 From: materus Date: Fri, 20 Mar 2026 08:35:04 +0100 Subject: [PATCH] Neovim init config. Formatting. Updates. --- config/editor/neovim/init.lua | 42 ++++++++++++++++ config/shell/zsh/zshrc | 6 ++- flake.lock | 48 +++++++++---------- flake.nix | 10 ++-- nix-config/home/materus/default.nix | 2 +- nix-config/host/materusPC/audio.nix | 1 - nix-config/host/materusPC/configuration.nix | 2 +- .../host/materusPC/hardware-configuration.nix | 3 +- .../host/materusPC/home-manager/materus.nix | 5 +- nix-config/host/materusPC/network.nix | 2 +- nix-config/shared/default.nix | 14 +++++- nix-config/shared/nvim.nix | 37 ++++++++++++++ 12 files changed, 137 insertions(+), 35 deletions(-) create mode 100644 config/editor/neovim/init.lua create mode 100644 nix-config/shared/nvim.nix diff --git a/config/editor/neovim/init.lua b/config/editor/neovim/init.lua new file mode 100644 index 0000000..1320217 --- /dev/null +++ b/config/editor/neovim/init.lua @@ -0,0 +1,42 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if vim.fn.executable("git") == 1 then + if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) + end + vim.opt.rtp:prepend(lazypath) + + local opts = {} + local plugins = { + { + "Mofiqul/dracula.nvim", + lazy = false, + priority = 1000, + opts = {} + }, + { + "romgrk/barbar.nvim", + init = function() vim.g.barbar_auto_setup = false end, + dependencies = {"nvim-tree/nvim-web-devicons","lewis6991/gitsigns.nvim"} + }, + + + --[[ + { + "kevinhwang91/nvim-ufo", + dependencies = {"kevinhwang91/promise-async"}, + opts = {} + }]] + } + + require("lazy").setup(plugins, opts) + + vim.cmd [[colorscheme dracula]] + vim.cmd [[set number]] +end diff --git a/config/shell/zsh/zshrc b/config/shell/zsh/zshrc index b1a2471..75e8c72 100644 --- a/config/shell/zsh/zshrc +++ b/config/shell/zsh/zshrc @@ -16,7 +16,6 @@ if zmodload zsh/terminfo && (( "$terminfo[colors]" >= "256" )); then __MATERUS_ZSH_256COLORS="${__MATERUS_ZSH_256COLORS:-0}"; fi - #region Plugins # Clone plugins if not exists [ -d $ZSH_DATA_DIR/plugins/powerlevel10k ] || git clone https://github.com/romkatv/powerlevel10k $ZSH_DATA_DIR/plugins/powerlevel10k @@ -104,6 +103,11 @@ speedtest() { } #endregion +#region Aliases +if [[ "$TERM" = "xterm-kitty" ]]; then + alias ssh="kitty +kitten ssh" +fi +#endregion if [[ "$__MATERUS_ZSH_256COLORS" = "1" ]] ; then [[ ! -f ${ZSH_CONFIG_DIR}/p10kcfg/fullcolor.zsh ]] || source ${ZSH_CONFIG_DIR}/p10kcfg/fullcolor.zsh; else [[ ! -f ${ZSH_CONFIG_DIR}/p10kcfg/compatibility.zsh ]] || source ${ZSH_CONFIG_DIR}/p10kcfg/compatibility.zsh; diff --git a/flake.lock b/flake.lock index a6ff8ed..e78930c 100644 --- a/flake.lock +++ b/flake.lock @@ -92,11 +92,11 @@ ] }, "locked": { - "lastModified": 1770260404, - "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", + "lastModified": 1773264488, + "narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=", "owner": "nix-community", "repo": "home-manager", - "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", + "rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c", "type": "github" }, "original": { @@ -114,11 +114,11 @@ ] }, "locked": { - "lastModified": 1770491427, - "narHash": "sha256-8b+0vixdqGnIIcgsPhjdX7EGPdzcVQqYxF+ujjex654=", + "lastModified": 1773422513, + "narHash": "sha256-MPjR48roW7CUMU6lu0+qQGqj92Kuh3paIulMWFZy+NQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "cbd8a72e5fe6af19d40e2741dc440d9227836860", + "rev": "ef12a9a2b0f77c8fa3dda1e7e494fca668909056", "type": "github" }, "original": { @@ -178,11 +178,11 @@ ] }, "locked": { - "lastModified": 1770519952, - "narHash": "sha256-Ba2onCjl55f34Nyopcgwao0ekcVx1TbWoXNZCVwSLJ8=", + "lastModified": 1773543606, + "narHash": "sha256-phMmtcMDGos4O82iEE3qFl58jp7fp1mu2liDE0A11gQ=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "efaad19ea43b72af40c8522418a8a3771a6e9d9b", + "rev": "014e1925a28b3e53f90883530ce6ff80e2da238a", "type": "github" }, "original": { @@ -200,11 +200,11 @@ ] }, "locked": { - "lastModified": 1770519952, - "narHash": "sha256-Ba2onCjl55f34Nyopcgwao0ekcVx1TbWoXNZCVwSLJ8=", + "lastModified": 1773543606, + "narHash": "sha256-phMmtcMDGos4O82iEE3qFl58jp7fp1mu2liDE0A11gQ=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "efaad19ea43b72af40c8522418a8a3771a6e9d9b", + "rev": "014e1925a28b3e53f90883530ce6ff80e2da238a", "type": "github" }, "original": { @@ -286,11 +286,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1770197578, - "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", + "lastModified": 1773389992, + "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", + "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda", "type": "github" }, "original": { @@ -318,11 +318,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1770464364, - "narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=", + "lastModified": 1773375660, + "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "23d72dabcb3b12469f57b37170fcbc1789bd7457", + "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", "type": "github" }, "original": { @@ -384,11 +384,11 @@ ] }, "locked": { - "lastModified": 1770526836, - "narHash": "sha256-xbvX5Ik+0inJcLJtJ/AajAt7xCk6FOCrm5ogpwwvVDg=", + "lastModified": 1773550941, + "narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d6e0e666048a5395d6ea4283143b7c9ac704720d", + "rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1", "type": "github" }, "original": { @@ -406,11 +406,11 @@ ] }, "locked": { - "lastModified": 1770526836, - "narHash": "sha256-xbvX5Ik+0inJcLJtJ/AajAt7xCk6FOCrm5ogpwwvVDg=", + "lastModified": 1773550941, + "narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d6e0e666048a5395d6ea4283143b7c9ac704720d", + "rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4c81d42..e2e3422 100644 --- a/flake.nix +++ b/flake.nix @@ -73,7 +73,7 @@ }; modules = [ ./nix-config/host/${host} - ./nix-config/shared + (import ./nix-config/shared false) ]; }); @@ -109,7 +109,7 @@ in [ ./nix-config/home/${user} - ./nix-config/shared + (import ./nix-config/shared true) ] ++ (if (host != null && builtins.pathExists host-path) then [ host-path ] else [ ]); extraSpecialArgs = extraArgs // { @@ -120,13 +120,17 @@ in rec { nixosConfigurations = { - materusPC = makeSystem { host = "materusPC"; }; + materusPC = makeSystem { + host = "materusPC"; + stable = true; + }; }; homeConfigurations = { "materus@materusPC" = makeHome { user = "materus"; host = "materusPC"; + stable = true; }; }; diff --git a/nix-config/home/materus/default.nix b/nix-config/home/materus/default.nix index cc3b39c..a36595f 100644 --- a/nix-config/home/materus/default.nix +++ b/nix-config/home/materus/default.nix @@ -20,7 +20,7 @@ xdg.enable = true; xdg.configFile."zsh/cfg".source = - config.lib.file.mkOutOfStoreSymlink "/mkk/config/config/shell/zsh"; + "${config.mkk.dir}/config/shell/zsh"; xdg.configFile."zsh/data/plugins/powerlevel10k".source = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k"; xdg.configFile."zsh/data/plugins/zsh-history-substring-search".source = diff --git a/nix-config/host/materusPC/audio.nix b/nix-config/host/materusPC/audio.nix index a16bb71..db2bdbd 100644 --- a/nix-config/host/materusPC/audio.nix +++ b/nix-config/host/materusPC/audio.nix @@ -46,7 +46,6 @@ odin2 surge fire - decent-sampler lsp-plugins ]; diff --git a/nix-config/host/materusPC/configuration.nix b/nix-config/host/materusPC/configuration.nix index 3b7b95d..6546c3c 100644 --- a/nix-config/host/materusPC/configuration.nix +++ b/nix-config/host/materusPC/configuration.nix @@ -307,6 +307,6 @@ in AllowHybridSleep=no AllowSuspendThenHibernate=no ''; - + system.stateVersion = "25.11"; } diff --git a/nix-config/host/materusPC/hardware-configuration.nix b/nix-config/host/materusPC/hardware-configuration.nix index 87e2d83..51067cd 100644 --- a/nix-config/host/materusPC/hardware-configuration.nix +++ b/nix-config/host/materusPC/hardware-configuration.nix @@ -179,7 +179,8 @@ in nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - + hardware.sane.enable = true; + hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ]; hardware.bluetooth = { enable = true; powerOnBoot = true; diff --git a/nix-config/host/materusPC/home-manager/materus.nix b/nix-config/host/materusPC/home-manager/materus.nix index 8e90f60..d2b5b36 100644 --- a/nix-config/host/materusPC/home-manager/materus.nix +++ b/nix-config/host/materusPC/home-manager/materus.nix @@ -1,5 +1,8 @@ -{ pkgs, materusArgs, ... }: +{ pkgs, materusArgs, config, ... }: { + mkk.neovim.enable = true; + + mkk.dir = config.lib.file.mkOutOfStoreSymlink "/mkk/config"; programs.git = { enable = true; lfs.enable = true; diff --git a/nix-config/host/materusPC/network.nix b/nix-config/host/materusPC/network.nix index ac0e784..3d77588 100644 --- a/nix-config/host/materusPC/network.nix +++ b/nix-config/host/materusPC/network.nix @@ -11,7 +11,7 @@ ''; networking.hostName = "materusPC"; - networking.wireless.iwd.enable = true; + #networking.wireless.iwd.enable = true; networking.networkmanager.enable = true; networking.firewall.enable = false; diff --git a/nix-config/shared/default.nix b/nix-config/shared/default.nix index d3179ba..24d667b 100644 --- a/nix-config/shared/default.nix +++ b/nix-config/shared/default.nix @@ -1,4 +1,16 @@ -{ ... }: +isHm: +{ lib, materusArgs, ... }: { + + options.mkk.dir = lib.mkOption { + default = "${materusArgs.flake-path}"; + type = lib.types.path; + }; + + imports = [ + (import ./nvim.nix isHm) + ]; + config._module.args.mkk = import ./private/variables.nix; + } diff --git a/nix-config/shared/nvim.nix b/nix-config/shared/nvim.nix new file mode 100644 index 0000000..d09d268 --- /dev/null +++ b/nix-config/shared/nvim.nix @@ -0,0 +1,37 @@ +isHm: +{ + config, + lib, + pkgs, + ... +}: +{ + options.mkk.neovim = { + enable = lib.mkOption { + default = false; + type = lib.types.bool; + }; + }; + config = + if isHm then + # Home Manager + lib.mkIf config.mkk.neovim.enable { + xdg.configFile."nvim/init.lua".source = "${config.mkk.dir}/config/editor/neovim/init.lua"; + home.packages = [ + pkgs.neovim + pkgs.neovide + pkgs.fd + pkgs.ripgrep + pkgs.tree-sitter + ]; + } + else + # NixOS + lib.mkIf config.mkk.neovim.enable { + + environment.systemPackages = [ + pkgs.neovim + pkgs.neovide + ]; + }; +}