refactor(flake-parts): initial flake-parts configuration

This commit is contained in:
ooks-io 2024-05-13 22:50:56 +12:00
parent 8f67be9e68
commit 5603001d65
230 changed files with 380 additions and 717 deletions

View file

@ -0,0 +1,57 @@
{ config, lib, inputs, pkgs, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.console.editor.nvim;
in
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
./settings.nix
./keymapping.nix
./plugins
];
config = lib.mkIf cfg.enable {
programs.neovim = {
viAlias = true;
vimAlias = true;
};
programs.nixvim = {
enable = true;
plugins = {
which-key = {
enable = true;
keyLabels = {
" " = "<space>";
};
};
};
colorschemes.base16 = {
enable = true;
colorscheme = config.colorscheme.slug;
customColorScheme = {
base00 = "#${colors.base00}";
base01 = "#${colors.base01}";
base02 = "#${colors.base02}";
base03 = "#${colors.base03}";
base04 = "#${colors.base04}";
base05 = "#${colors.base05}";
base06 = "#${colors.base06}";
base07 = "#${colors.base07}";
base08 = "#${colors.base08}";
base09 = "#${colors.base09}";
base0A = "#${colors.base0A}";
base0B = "#${colors.base0B}";
base0C = "#${colors.base0C}";
base0D = "#${colors.base0D}";
base0E = "#${colors.base0E}";
base0F = "#${colors.base0F}";
};
};
};
};
}

View file

@ -0,0 +1,50 @@
{ config, lib, ... }:
let
cfg = config.homeModules.console.editor.nvim;
in
{
config = lib.mkIf cfg.enable {
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = let
normal =
lib.mapAttrsToList
(key: action: {
mode = "n";
inherit action key;
})
{
"<Space>" = "<NOP>";
"esc" = ":noh<CR>";
"Y" = "$y";
};
visual =
lib.mapAttrsToList
(key: action: {
mode = "v";
inherit action key;
})
{
# better indenting
">" = ">gv";
"<" = "<gv";
"<TAB>" = ">gv";
"<S-TAB>" = "<gv";
# move selected line / block of text in visual mode
"K" = ":m '<-2<CR>gv=gv";
"J" = ":m '>+1<CR>gv=gv";
};
in
config.nixvim.helpers.keymaps.mkKeymaps
{options.silent = true;}
(normal ++ visual);
};
};
}

View file

@ -0,0 +1,28 @@
{ lib, ... }:
{
imports = [
./indent.nix
./telescope.nix
./lualine.nix
];
options.homeModules.console.editor.nvim.plugins = {
indentBlankline = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable indent-blankline nvim plugin module";
};
lualine = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable lualine nvim plugin module";
};
telescope = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable telescope nvim plugin module";
};
};
}

View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.homeModules.console.editor.nvim.plugins;
in
{
config = lib.mkIf cfg.indentBlankline {
programs.nixvim.plugins.indent-blankline = {
enable = true;
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, ... }:
let
cfg = config.homeModules.console.editor.nvim.plugins;
in
{
config = lib.mkIf cfg.lualine {
programs.nixvim.plugins.lualine = {
enable = true;
theme = "base16";
globalstatus = true;
sections = {
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = ["diagnostics"];
lualine_y = ["fileformat"];
lualine_z = ["filetype"];
};
};
};
}

View file

@ -0,0 +1,41 @@
{ config, lib, ... }:
let
cfg = config.homeModules.console.editor.nvim.plugins;
in
{
config = lib.mkIf cfg.telescope {
programs.nixvim = {
plugins.telescope = {
enable = true;
extensions = {
fzf-native.enable = true;
frecency.enable = true;
};
keymaps = {
"<leader>ff" = "find_files";
"<leader>fg" = "live_grep";
"<leader>b" = "buffers";
"<leader>fh" = "help_tags";
"<leader>fd" = "diagnostics";
"<C-p>" = "git_files";
"<leader>p" = "oldfiles";
"<C-f>" = "live_grep";
};
keymapsSilent = true;
defaults = {
file_ignore_patterns = [
"^.git/"
"^data/"
];
set_env.COLORTERM = "truecolor";
};
};
};
};
}

View file

@ -0,0 +1,60 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.homeModules.console.editor.nvim;
in
{
config = lib.mkIf cfg.enable {
programs.nixvim = {
options = {
relativenumber = true;
number = true;
hidden = true;
mouse = "a";
mousemodel = "extend";
undofile = true;
swapfile = false;
incsearch = true;
ignorecase = true;
smartcase = true;
fileencoding = "utf-8";
termguicolors = true;
autoindent = true;
shiftwidth = 2;
smartindent = true;
expandtab = true;
updatetime = 100;
};
clipboard = {
register = "unnamedplus";
providers.wl-copy.enable = true;
};
colorschemes.base16 = {
enable = true;
colorscheme = config.colorscheme.slug;
customColorScheme = {
base00 = "#${colors.base00}";
base01 = "#${colors.base01}";
base02 = "#${colors.base02}";
base03 = "#${colors.base03}";
base04 = "#${colors.base04}";
base05 = "#${colors.base05}";
base06 = "#${colors.base06}";
base07 = "#${colors.base07}";
base08 = "#${colors.base08}";
base09 = "#${colors.base09}";
base0A = "#${colors.base0A}";
base0B = "#${colors.base0B}";
base0C = "#${colors.base0C}";
base0D = "#${colors.base0D}";
base0E = "#${colors.base0E}";
base0F = "#${colors.base0F}";
};
};
};
};
}