nix: Modularize editor

Now I know how to abstract modules into separate files instead of having
one big file for everything.
This commit is contained in:
Donovan Glover 2023-05-09 11:43:25 -04:00
parent f8e257a89d
commit 1c99ffd784
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 45 additions and 36 deletions

View File

@ -5,12 +5,14 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs: {
nixosConfigurations.nixos = inputs.nixpkgs.lib.nixosSystem {
outputs = { self, nixpkgs, home-manager, ... }@attrs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
./configuration.nix
inputs.home-manager.nixosModules.home-manager
./modules/editor.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
users.users.user = {
@ -80,39 +82,6 @@
fade-in = 1;
};
};
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [{
plugin = nvim-tree-lua;
type = "lua";
config = ''
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
require("nvim-tree").setup()
'';
}
{
plugin = indent-blankline-nvim;
type = "lua";
config = ''
vim.cmd [[highlight IndentBlanklineIndent1 guibg=#1f1f1f gui=nocombine]]
vim.cmd [[highlight IndentBlanklineIndent2 guibg=#1a1a1a gui=nocombine]]
require("indent_blankline").setup {
char = "",
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
},
space_char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
},
show_trailing_blankline_indent = false,
}
'';
}];
};
editorconfig = {
enable = true;
settings = {

40
modules/editor.nix Normal file
View File

@ -0,0 +1,40 @@
{ config, lib, nixpkgs, home-manager, ... }: {
imports = [ home-manager.nixosModule ];
home-manager.users.user = { pkgs, ... }: {
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
{
plugin = nvim-tree-lua;
type = "lua";
config = ''
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
require("nvim-tree").setup()
'';
}
{
plugin = indent-blankline-nvim;
type = "lua";
config = ''
vim.cmd [[highlight IndentBlanklineIndent1 guibg=#1f1f1f gui=nocombine]]
vim.cmd [[highlight IndentBlanklineIndent2 guibg=#1a1a1a gui=nocombine]]
require("indent_blankline").setup {
char = "",
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
},
space_char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
},
show_trailing_blankline_indent = false,
}
'';
}
];
};
};
}