working nixvim!

This commit is contained in:
Charlie Root 2024-05-21 23:41:23 +02:00
commit cee77dd6af
8 changed files with 100 additions and 20 deletions

View file

@ -1,5 +1,5 @@
{
description = "lololo";
description = "My NixOS config flake";
outputs = inputs@{ self, nixpkgs, ... }: {
inherit (nixpkgs) lib;
nixosConfigurations = import ./hosts { inherit inputs; };
@ -51,8 +51,8 @@
spicetify-nix.url = "github:the-argus/spicetify-nix";
nur = { url = "github:nix-community/NUR"; };
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";

View file

@ -12,6 +12,7 @@ in {
../modules
inputs.home-manager.nixosModules.home-manager
inputs.agenix.nixosModules.default
inputs.nixvim.nixosModules.nixvim
];
};

View file

@ -64,7 +64,7 @@
editors = {
emacs = {
enable = false;
doom.enable = false;
doom.enable = false;
};
helix.enable = true;
kakoune.enable = true;

View file

@ -75,6 +75,7 @@ in {
polkit
python3
qbittorrent
ripgrep
rustdesk
scc
scummvm

View file

@ -1 +1 @@
_: { imports = [ ./emacs.nix ./helix.nix ./kakoune.nix ]; }
_: { imports = [ ./emacs.nix ./helix.nix ./kakoune.nix ./nixvim.nix ]; }

View file

@ -1,12 +1,11 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.editors.helix;
username = config.modules.other.system.username;
in {
options.modules.editors.helix.enable = mkEnableOption "helix";
options.modules.editors.helix.enable = lib.mkEnableOption "helix";
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
programs.helix = {
enable = true;
@ -20,7 +19,7 @@ in {
cursor-shape = { insert = "bar"; };
statusline.left =
[ "mode" "spinner" "version-control" "file-name" ];
[ "mode" "spinner" "version-control" "file-name" ];
};
keys.normal = {
C-g =

View file

@ -1,14 +1,93 @@
{pkgs, config, lib, ...}:
with lib;
let
cfg = config.modules.editors.nixvim;
inherit (inputs.nixvim.packges.${pkgs.system}) nixvim;
{ config, lib, ... }:
let cfg = config.modules.editors.nixvim;
in {
options.modules.editors.nivim.enable = mkEnableOption "nixvim";
config = mkIf cfg.enable {
options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim";
config = lib.mkIf cfg.enable {
programs.nixvim = {
enable = true;
enable = true;
colorschemes.gruvbox.enable = true;
options = {
number = true;
relativenumber = true;
shiftwidth = 2;
scrolloff = 8;
};
plugins = {
lightline.enable = true;
lsp = {
enable = true;
servers = {
nixd.enable = true;
lua-ls.enable = true;
};
};
cmp = {
enable = true;
settings = {
sources = [ { name = "nvim_lsp"; } { name = "buffer"; } { name = "path"; } ];
mapping = {
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<Tab>" = {
action = ''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
else
fallback()
end
end
'';
modes = [ "i" "s" ];
};
};
};
};
telescope = {
enable = true;
extensions = {
fzf-native = {
enable = true;
settings = {
fuzzy = true;
override_file_sorter = true;
override_generic_sorter = true;
case_mode = "smart_case";
};
};
};
};
treesitter.enable = true;
treesitter-context.enable = true;
comment.enable = true;
gitblame.enable = true;
trouble.enable = true;
todo-comments.enable = true;
fugitive.enable = true;
nvim-autopairs.enable = true;
diffview.enable = true;
oil.enable = true;
undotree.enable = true;
fzf-lua.enable = true;
surround.enable = true;
lazygit.enable = true;
# Theming
gitsigns.enable = true;
# barbar.enable = true;
lualine = {
enable = true;
#theme = "palenight";
};
nix.enable = true;
zig.enable = true;
};
};
};
}

View file

@ -3,13 +3,13 @@ let
username = config.modules.other.system.username;
hmCfg = config.home-manager.users.${username};
primary_browser = "firefox-schizo.desktop";
primary_browser = "Schizofox.desktop";
mail_client = "thunderbird.desktop";
file_manager = "nautilus.desktop";
media_player = "mpv.desktop";
image_viewer = "imv.desktop";
text_editor = "helix.desktop";
terminal = "kitty.desktop";
terminal = "foot.desktop";
in {
environment.sessionVariables = { TERMINAL = "${terminal}"; };