Neovim init config. Formatting. Updates.

This commit is contained in:
Mateusz Słodkowicz 2026-03-20 08:35:04 +01:00
parent bd10321f19
commit 576b955023
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
12 changed files with 137 additions and 35 deletions

View File

@ -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

View File

@ -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;

48
flake.lock generated
View File

@ -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": {

View File

@ -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;
};
};

View File

@ -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 =

View File

@ -46,7 +46,6 @@
odin2
surge
fire
decent-sampler
lsp-plugins
];

View File

@ -307,6 +307,6 @@ in
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
system.stateVersion = "25.11";
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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
];
};
}