This commit is contained in:
fqbn207
2025-01-16 01:12:53 +01:00
parent 7f29f372d0
commit 034fc6c781
13 changed files with 272 additions and 38 deletions

View File

@ -3,9 +3,8 @@
lib,
pkgs,
...
}: let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in {
}:
{
imports = [
./hardware-configuration.nix
./modules/system/nix/default.nix
@ -43,7 +42,7 @@ in {
useOSProber = true;
};
};
supportedFilesystems = ["ntfs"];
supportedFilesystems = [ "ntfs" ];
};
networking = {
@ -231,6 +230,7 @@ in {
vesktop
pacman
wf-recorder
];
security = {
@ -238,7 +238,7 @@ in {
enable = true;
extraRules = [
{
users = ["fabian"];
users = [ "fabian" ];
noPass = true;
keepEnv = true;
}
@ -270,5 +270,4 @@ in {
system.stateVersion = "unstable";
home-manager.users.fabian = ./modules/home/home.nix;
}

21
flake.lock generated
View File

@ -36,6 +36,26 @@
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1736785676,
"narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"mnw": {
"locked": {
"lastModified": 1735150973,
@ -2239,6 +2259,7 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nvf": "nvf"
}

View File

@ -3,25 +3,30 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nvf.url = "github:notashelf/nvf";
};
outputs = {
self,
nixpkgs,
home-manager,
nvf,
}: {
packages."x86_64-linux".default =
(nvf.lib.neovimConfiguration {
pkgs = nixpkgs.legacyPakcages."x86_64-linux";
modules = [./modules/system/nix/nvim/default.nix];
})
.neovim;
nixosConfigurations.poggers = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
nvf.homeManagerModules.default
nvf.nixosModules.default
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.fabian = import ./modules/home/home.nix;
};
}
];
};
};

View File

@ -0,0 +1,30 @@
{
pkgs,
lib,
...
}: {
programs.nvf.settings.vim = {
extraLuaFiles = [
(builtins.path {
path = ./raw/cmp.lua;
name = "my-lua-file";
})
];
autocomplete = {
nvim-cmp = {
enable = true;
setupOpts = {
completion = {
completeopt = "menu,menuone,noinsert,noselect";
};
};
sourcePlugins = [
"crates-nvim"
"cmp-path"
"cmp-nvim-lsp"
"rustaceanvim"
];
};
};
};
}

View File

@ -8,12 +8,27 @@
./terminal.nix
./neotree.nix
./opts.nix
./cmp.nix
];
programs.nvf = {
enable = true;
settings = {
vim = {
extraLuaFiles = [
(builtins.path {
path = ./raw/opts.lua;
name = "opts.lua";
})
];
autopairs.nvim-autopairs.enable = true;
statusline.lualine = {
enable = true;
};
telescope.enable = true;
theme = {
enable = true;
name = "horizon";
style = "dark";
};
};
};
};
}

View File

@ -0,0 +1,35 @@
{
pkgs,
lib,
...
}: {
imports = [
./lsp.nix
./terminal.nix
./neotree.nix
./opts.nix
./cmp.nix
];
programs.nvf = {
enable = true;
settings = {
vim = {
extraLuaFiles = [
(builtins.path {
path = ./raw/opts.lua;
name = "opts.lua"
})
];
autopairs.nvim-autopairs.enable = true;
statusline.lualine = {
enable = true;
};
telescope.enable = true;
theme = {
enable = true;
};
};
};
};
}

View File

@ -3,7 +3,7 @@
lib,
...
}: {
vim = {
programs.nvf.settings.vim = {
languages = {
clang = {
enable = true;
@ -11,6 +11,15 @@
treesitter.enable = true;
lsp.enable = true;
};
python = {
enable = true;
};
go = {
enable = true;
};
lua = {
enable = true;
};
rust = {
enable = true;
dap.enable = true;

View File

@ -3,7 +3,7 @@
lib,
...
}: {
vim = {
programs.nvf.settings.vim = {
filetree = {
neo-tree = {
enable = true;

View File

@ -1,15 +0,0 @@
{
pkgs,
lib,
...
}: {
vim = {
globals = {
mapleader = " ";
shiftwidth = 2;
tabstop = 2;
softtabstop = 2;
};
};
}

View File

@ -0,0 +1,59 @@
local cmp = require("cmp")
vim.opt.completeopt = { "menu", "menuone", "noinsert", "noselect" }
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
sorting = {
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.recently_used,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<C-Left>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lua' },
{ name = 'emoji' },
}),
highlight = {
default = "Subtle"
},
})

View File

@ -0,0 +1,37 @@
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.cursorline = true
vim.opt.expandtab = true
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.softtabstop = 4
vim.opt.relativenumber = true
vim.diagnostic.config({
virtual_text = true,
virtual_lines = true,
})
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
vim.g.mapleader = " "
map('n', '<c-t>', ":ToggleTerm size=40<CR>", opts)
map('n', '<c-n>', ":Neotree filesystem reveal toggle<CR>", opts)
map('v', '<Tab>', '>gv', opts)
map('v', '<S-Tab>', '<gv', opts)
vim.cmd [[
set nobackup
cnoreabbrev W! w!
cnoreabbrev Q! q!
cnoreabbrev Qall! qall!
cnoreabbrev Wq wq
cnoreabbrev Wa wa
cnoreabbrev wQ wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall
]]

View File

@ -0,0 +1,37 @@
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.cursorline = true
vim.opt.expandtab = true
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.softtabstop = 4
vim.opt.relativenumber = true
vim.diagnostic.config({
virtual_text = true,
virtual_lines = true,
})
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
vim.g.mapleader = " "
map('n', '<c-t>', ":ToggleTerm size=40<CR>", opts)
map('n', '<c-n>', ":Neotree filesystem reveal toggle<CR>", opts)
map('v', '<Tab>', '>gv', opts)
map('v', '<S-Tab>', '<gv', opts)
vim.cmd [[
set nobackup
cnoreabbrev W! w!
cnoreabbrev Q! q!
cnoreabbrev Qall! qall!
cnoreabbrev Wq wq
cnoreabbrev Wa wa
cnoreabbrev wQ wq
cnoreabbrev WQ wq
cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall
]]

View File

@ -3,10 +3,12 @@
lib,
...
}: {
vim = {
programs.nvf.settings.vim = {
terminal = {
toggleterm = {
enable = true;
lazygit.enable = true;
};
};
};
}