Start nixvim config

This commit is contained in:
Johannes Rothe 2024-12-21 01:30:34 +01:00
parent fa03fd3be9
commit 082240c343
5 changed files with 254 additions and 50 deletions

145
flake.lock generated
View File

@ -2,7 +2,9 @@
"nodes": { "nodes": {
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1733168902, "lastModified": 1733168902,
@ -18,6 +20,45 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -39,23 +80,35 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1732238832, "lastModified": 1729958008,
"narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=", "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NixOS", "owner": "NuschtOS",
"repo": "nixpkgs", "repo": "ixx",
"rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d", "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NuschtOS",
"ref": "nixpkgs-unstable", "ref": "v0.0.6",
"repo": "nixpkgs", "repo": "ixx",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733261153, "lastModified": 1733261153,
"narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=", "narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=",
@ -71,11 +124,79 @@
"type": "github" "type": "github"
} }
}, },
"nixvim": {
"inputs": {
"devshell": [],
"flake-compat": [],
"flake-parts": "flake-parts",
"git-hooks": [],
"home-manager": [],
"nix-darwin": [],
"nixpkgs": [
"nixpkgs"
],
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": []
},
"locked": {
"lastModified": 1734447589,
"narHash": "sha256-APyzO3pn6iiGJxkWczifnxm3pKZrNYgpJUPpnVfUwsk=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "4f0d5e0d2947dbf111f2ce00c99ca4c6c659dc79",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "nixos-24.11",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733773348,
"narHash": "sha256-Y47y+LesOCkJaLvj+dI/Oa6FAKj/T9sKVKDXLNsViPw=",
"owner": "NuschtOS",
"repo": "search",
"rev": "3051be7f403bff1d1d380e4612f0c70675b44fc9",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs",
"nixvim": "nixvim"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
} }
} }
}, },

View File

@ -2,13 +2,26 @@
description = "NixOS configuration flake"; description = "NixOS configuration flake";
inputs = { inputs = {
disko.url = "github:nix-community/disko";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.11"; home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs = {
nixpkgs.follows = "nixpkgs";
devshell.follows = "";
flake-compat.follows = "";
git-hooks.follows = "";
home-manager.follows = "";
nix-darwin.follows = "";
treefmt-nix.follows = "";
};
};
}; };
outputs = { self, nixpkgs, home-manager, disko,...}: outputs = { self, nixpkgs, home-manager, disko, nixvim, ...}:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
@ -23,7 +36,7 @@
]; ];
}; };
tien = nixpkgs.lib.nixosSystem { tien = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
modules = [ modules = [
disko.nixosModules.disko disko.nixosModules.disko
./vps-configuration.nix ./vps-configuration.nix
@ -35,8 +48,9 @@
"rothe@lift" = home-manager.lib.homeManagerConfiguration { "rothe@lift" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home/rothe.nix ./home/terminal
./home/wayland ./home/wayland
nixvim.homeManagerModules.nixvim
]; ];
extraSpecialArgs = { extraSpecialArgs = {
mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"]; mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"];
@ -45,7 +59,8 @@
"rothe@johannes-powermachine" = home-manager.lib.homeManagerConfiguration { "rothe@johannes-powermachine" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home/rothe.nix ./home/terminal
nixvim.homeManagerModules.nixvim
]; ];
extraSpecialArgs = { extraSpecialArgs = {
mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"]; mail = nixpkgs.lib.strings.concatStrings ["mail" "@" "johannes-rothe.de"];
@ -54,7 +69,8 @@
"rothe@pdemu1cml000301" = home-manager.lib.homeManagerConfiguration { "rothe@pdemu1cml000301" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home/rothe.nix ./home/terminal
nixvim.homeManagerModules.nixvim
]; ];
extraSpecialArgs = { extraSpecialArgs = {
mail = nixpkgs.lib.strings.concatStrings ["rothe" "@" "magazino.eu"]; mail = nixpkgs.lib.strings.concatStrings ["rothe" "@" "magazino.eu"];

View File

@ -1,26 +0,0 @@
{ config, pkgs, lib, ... }:
{
home.username = "rothe";
home.homeDirectory = "/home/rothe";
imports = [
./terminal
];
# Add extra variables like $EDITOR
home.sessionVariables = {
};
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

View File

@ -1,7 +1,16 @@
{ config, pkgs, lib, mail, ... }: { config, pkgs, lib, mail, ... }:
{ {
imports = [ ./nixvim ];
config = { config = {
home.username = "rothe";
home.homeDirectory = "/home/rothe";
# Add extra variables like $EDITOR
home.sessionVariables = {
};
home.packages = with pkgs; [ home.packages = with pkgs; [
black black
devenv devenv
@ -245,7 +254,17 @@
programs.direnv = { programs.direnv = {
enable = true; enable = true;
}; };
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}; };
} }

View File

@ -0,0 +1,74 @@
{ config, pkgs, lib, mail, ... }:
{
# TODO
# Linter (ale)
# Markdown spellcheck
# Autocomplete
# Missing plugins
# Telescope and fuzzy finder
# Ruff linter for python and black
# Format on exit
# Good example: https://github.com/fred-drake/neovim/blob/master/config/python/language.nix
programs.nixvim = {
colorscheme = "sonokai";
enable = true;
extraPlugins = [
pkgs.vimPlugins.indentLine
pkgs.vimPlugins.polyglot
pkgs.vimPlugins.sonokai
];
globals = {
mapleader = ",";
sonokai_style = "atlantis";
sonokai_disable_italic_comment = 1;
};
keymaps = [
{
key = "<leader>t";
action = "<cmd>Neotree toggle<CR>";
}
];
opts = {
colorcolumn = "88";
cursorline = true;
number = true;
termguicolors = true;
};
plugins = {
cmp = {
enable = true; # Completion
autoEnableSources = true;
settings.sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
settings.mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })";
};
};
committia.enable = true;
gitgutter.enable = true;
guess-indent.enable = true;
lsp.enable = true;
lsp.servers.pylsp = {
enable = true;
settings.plugins = {
black.enabled = true;
isort.enabled = true;
ruff.enabled = true;
};
};
lualine.enable = true;
neo-tree.enable = true;
web-devicons.enable = true;
};
};
}