updated nvim config, added local_ai
This commit is contained in:
75
flake.lock
generated
75
flake.lock
generated
@@ -20,6 +20,25 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"comfy-ui": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786714237,
|
||||
"narHash": "sha256-XnXKBpaidykfCegAqBGI7/F61IFtMSKUibQct/dP2Zw=",
|
||||
"owner": "utensils",
|
||||
"repo": "comfyui-nix",
|
||||
"rev": "4501c5fe8dd93530d856866ba8bc4b585b508d41",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "utensils",
|
||||
"repo": "comfyui-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -40,6 +59,24 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1767609335,
|
||||
"narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "250481aafeb741edfe23d29195671c19b36b6dca",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -63,7 +100,7 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786717298,
|
||||
@@ -81,6 +118,37 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1766902085,
|
||||
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1765674936,
|
||||
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1767892417,
|
||||
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
|
||||
@@ -93,7 +161,7 @@
|
||||
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1786711500,
|
||||
"narHash": "sha256-QvnceIGTBeDvDd9oCn+GvdsnkquliuwbVgpiRH68qaQ=",
|
||||
@@ -112,10 +180,11 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"antigravity": "antigravity",
|
||||
"comfy-ui": "comfy-ui",
|
||||
"disko": "disko",
|
||||
"home-manager": "home-manager",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
32
flake.nix
32
flake.nix
@@ -19,9 +19,14 @@
|
||||
url = "github:Hy4ri/antigravity-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
comfy-ui = {
|
||||
url = "github:utensils/comfyui-nix";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs:
|
||||
outputs =
|
||||
inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
|
||||
@@ -33,6 +38,7 @@
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
inputs.antigravity.overlays.default
|
||||
inputs.comfy-ui.overlays.default
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
@@ -44,7 +50,8 @@
|
||||
};
|
||||
}
|
||||
];
|
||||
in {
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
hades = inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
@@ -55,5 +62,26 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
devShells.${system}.default =
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ inputs.antigravity.overlays.default ];
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
llvmPackages_latest.clang
|
||||
llvmPackages_latest.lld
|
||||
llvmPackages_latest.lldb
|
||||
llvmPackages_latest.llvm
|
||||
llvmPackages_latest.clang-tools
|
||||
llvmPackages_latest.libcxx
|
||||
rustup
|
||||
uv
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
./foot.nix
|
||||
./brave.nix
|
||||
./zsh.nix
|
||||
./nvim
|
||||
];
|
||||
|
||||
xdg.portal.config.common.default = "*";
|
||||
|
||||
2
home/nvim/config/init.lua
Normal file
2
home/nvim/config/init.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Bootstrap lazy.nvim, LazyVim and custom plugins
|
||||
require("config.lazy")
|
||||
5
home/nvim/config/lua/config/autocmds.lua
Normal file
5
home/nvim/config/lua/config/autocmds.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds set by LazyVim:
|
||||
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
|
||||
-- Custom autocmds can be defined here
|
||||
8
home/nvim/config/lua/config/keymaps.lua
Normal file
8
home/nvim/config/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps set by LazyVim:
|
||||
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- Custom keymaps can be added below:
|
||||
-- Example: map("n", "<leader>pv", vim.cmd.Ex, { desc = "Open file explorer" })
|
||||
56
home/nvim/config/lua/config/lazy.lua
Normal file
56
home/nvim/config/lua/config/lazy.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- 1. Add LazyVim core and import its default plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
|
||||
-- 2. Optional LazyVim Extras (uncomment or add extras as needed)
|
||||
{ import = "lazyvim.plugins.extras.lang.nix" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
|
||||
-- 3. Import user plugins from lua/plugins/*.lua
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- Plugins load during startup unless explicitly marked lazy
|
||||
lazy = false,
|
||||
-- Always track latest git commit
|
||||
version = false,
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
paths = vim.env.NVIM_TREESITTER_PARSERS and { vim.env.NVIM_TREESITTER_PARSERS } or {},
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
17
home/nvim/config/lua/config/options.lua
Normal file
17
home/nvim/config/lua/config/options.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set by LazyVim:
|
||||
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Tab and indentation settings
|
||||
opt.tabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
opt.expandtab = true
|
||||
|
||||
-- Line numbers
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
-- Clipboard integration with system/Wayland
|
||||
opt.clipboard = "unnamedplus"
|
||||
24
home/nvim/config/lua/plugins/colorscheme.lua
Normal file
24
home/nvim/config/lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
-- Tokyo Night colorscheme configuration
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {
|
||||
style = "night",
|
||||
transparent = true,
|
||||
styles = {
|
||||
sidebars = "transparent",
|
||||
floats = "transparent",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure LazyVim to use tokyonight by default
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "tokyonight",
|
||||
},
|
||||
},
|
||||
}
|
||||
48
home/nvim/config/lua/plugins/extras.lua
Normal file
48
home/nvim/config/lua/plugins/extras.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
-- User custom plugin configurations and overrides
|
||||
return {
|
||||
-- Disable Mason on NixOS (all LSPs/formatters/linters are managed declaratively via Nix)
|
||||
{ "mason.nvim", enabled = false },
|
||||
{ "mason-lspconfig.nvim", enabled = false },
|
||||
{ "mason-nvim-dap.nvim", enabled = false },
|
||||
|
||||
-- Treesitter configuration tailored for NixOS
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- Nix provides all precompiled grammars in ~/.config/nvim/parser and rtp.
|
||||
-- Clear LazyVim's default ensure_installed list to prevent compile triggers on startup.
|
||||
opts.ensure_installed = {}
|
||||
opts.auto_install = false
|
||||
opts.sync_install = false
|
||||
opts.highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
}
|
||||
opts.indent = { enable = true }
|
||||
end,
|
||||
},
|
||||
|
||||
-- Example: Telescope / fzf configuration
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Linting configuration (graceful fallback if linters are not yet in PATH)
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||
if vim.fn.executable("statix") == 0 then
|
||||
opts.linters_by_ft["nix"] = {}
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
76
home/nvim/default.nix
Normal file
76
home/nvim/default.nix
Normal file
@@ -0,0 +1,76 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
treesitterParsers = pkgs.symlinkJoin {
|
||||
name = "treesitter-parsers";
|
||||
paths = builtins.attrValues pkgs.vimPlugins.nvim-treesitter.passthru.grammarPlugins;
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
withNodeJs = true;
|
||||
withPython3 = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
# Native compilation tools & Treesitter CLI
|
||||
gcc
|
||||
clang
|
||||
gnumake
|
||||
cmake
|
||||
tree-sitter
|
||||
|
||||
# Search & Fuzzy Finding
|
||||
ripgrep
|
||||
fd
|
||||
fzf
|
||||
|
||||
# Archive and Network Utilities
|
||||
git
|
||||
curl
|
||||
unzip
|
||||
gnutar
|
||||
gzip
|
||||
|
||||
# Language Servers, Linters & Formatters (Declarative, no Mason needed)
|
||||
# Nix
|
||||
nil
|
||||
nixfmt
|
||||
statix
|
||||
# Lua
|
||||
lua-language-server
|
||||
stylua
|
||||
# C / C++
|
||||
llvmPackages_latest.clang-tools
|
||||
llvmPackages_latest.lldb
|
||||
# Rust
|
||||
rust-analyzer
|
||||
# Python
|
||||
pyright
|
||||
ruff
|
||||
# Web / TypeScript / JavaScript / HTML / CSS / JSON
|
||||
vtsls
|
||||
vscode-langservers-extracted
|
||||
prettier
|
||||
# Shell
|
||||
shfmt
|
||||
shellcheck
|
||||
];
|
||||
|
||||
extraWrapperArgs = [
|
||||
"--set" "NVIM_TREESITTER_PARSERS" "${treesitterParsers}"
|
||||
];
|
||||
};
|
||||
|
||||
# Symlink LazyVim configuration to ~/.config/nvim recursively
|
||||
xdg.configFile."nvim" = {
|
||||
source = ./config;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
# Symlink precompiled Treesitter parsers directly into ~/.config/nvim/parser
|
||||
xdg.configFile."nvim/parser".source = "${treesitterParsers}/parser";
|
||||
}
|
||||
19
home/zsh.nix
19
home/zsh.nix
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.bat = {
|
||||
@@ -26,7 +31,10 @@
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
options = [ "--cmd" "cd" ];
|
||||
options = [
|
||||
"--cmd"
|
||||
"cd"
|
||||
];
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
@@ -35,7 +43,10 @@
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
highlighters = [ "main" "brackets" ];
|
||||
highlighters = [
|
||||
"main"
|
||||
"brackets"
|
||||
];
|
||||
};
|
||||
|
||||
oh-my-zsh = {
|
||||
@@ -96,6 +107,8 @@
|
||||
setup = "source ./setup_env.sh";
|
||||
gpuenv = "__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia";
|
||||
digital = "$HOME/Tools/Digital/Digital.sh";
|
||||
nixos_test = "sudo nixos_rebuild test --flake $HOME/NixOS-Configs#hades";
|
||||
nixos_switch = "sudo nixos_rebuild switch --flake $HOME/NixOS-Configs#hades";
|
||||
};
|
||||
|
||||
initContent = lib.mkMerge [
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -8,6 +14,7 @@
|
||||
./display-configuration.nix
|
||||
../../modules/hardware/nvidia.nix
|
||||
../../modules/apps/gaming.nix
|
||||
../../modules/apps/local_ai.nix
|
||||
];
|
||||
|
||||
networking.hostName = "hades";
|
||||
@@ -35,4 +42,3 @@
|
||||
nvtopPackages.nvidia
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -8,5 +8,18 @@
|
||||
ghidra
|
||||
antigravity-cli
|
||||
pi-coding-agent
|
||||
|
||||
# Clang & LLVM Toolchain
|
||||
llvmPackages_latest.clang
|
||||
llvmPackages_latest.lld
|
||||
llvmPackages_latest.lldb
|
||||
llvmPackages_latest.llvm
|
||||
llvmPackages_latest.clang-tools
|
||||
llvmPackages_latest.libcxx
|
||||
|
||||
# Nix Tools
|
||||
nil
|
||||
nixfmt
|
||||
statix
|
||||
];
|
||||
}
|
||||
|
||||
38
modules/apps/local_ai.nix
Normal file
38
modules/apps/local_ai.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.comfy-ui.nixosModules.default
|
||||
];
|
||||
|
||||
services = {
|
||||
comfyui = {
|
||||
enable = true;
|
||||
gpuSupport = "cuda";
|
||||
enableManager = true;
|
||||
port = 8188;
|
||||
listenAddress = "0.0.0.0";
|
||||
dataDir = "/var/lib/comfyui";
|
||||
user = "comfyui";
|
||||
group = "comfyui";
|
||||
createUser = true;
|
||||
};
|
||||
|
||||
ollama = {
|
||||
enable = true;
|
||||
package = pkgs.ollama-cuda;
|
||||
host = "0.0.0.0";
|
||||
port = 11434;
|
||||
user = "ollama";
|
||||
group = "ollama";
|
||||
home = "/var/lib/ollama";
|
||||
};
|
||||
|
||||
open-webui.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
comfy-ui-cuda
|
||||
ollama-cuda
|
||||
];
|
||||
}
|
||||
@@ -3,8 +3,13 @@
|
||||
{
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
auto-optimise-store = true;
|
||||
substituters = [ "https://cache.nixos-cuda.org" ];
|
||||
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
|
||||
};
|
||||
|
||||
gc = {
|
||||
|
||||
@@ -18,10 +18,14 @@
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Enable running generic unpatched dynamic binaries (Mason, Tree-sitter CLI, language servers, etc.)
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
curl
|
||||
wget
|
||||
aria2
|
||||
btop
|
||||
gparted
|
||||
pciutils
|
||||
|
||||
Reference in New Issue
Block a user