feat(home:nvim): move to external neovim flake

This commit is contained in:
ooks-io 2024-07-22 11:51:59 +12:00
parent 3fe90d2e5f
commit 5e2324a9d6
15 changed files with 187 additions and 414 deletions

212
flake.lock generated
View file

@ -127,6 +127,7 @@
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": [
"ookvim",
"nixvim",
"nixpkgs"
]
@ -182,6 +183,22 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -246,18 +263,37 @@
}
},
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1719745305,
"narHash": "sha256-xwgjVUpqSviudEkpQnioeez1Uo2wzrsMaJKJClh+Bls=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c3c5ecc05edc7dafba779c6c1a61cd08ac6583e9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_5": {
"inputs": {
"nixpkgs-lib": [
"ookvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github"
},
"original": {
@ -388,26 +424,25 @@
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"ookvim",
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"ookvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1720524665,
"narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=",
"lastModified": 1719259945,
"narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1",
"rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07",
"type": "github"
},
"original": {
@ -419,6 +454,7 @@
"gitignore": {
"inputs": {
"nixpkgs": [
"ookvim",
"nixvim",
"git-hooks",
"nixpkgs"
@ -438,6 +474,22 @@
"type": "github"
}
},
"gruvbox-material": {
"flake": false,
"locked": {
"lastModified": 1719323321,
"narHash": "sha256-gQO6PrZ0ss9TyD2Q9yxtsJFCWemIZcPy4p8EQz+/Ezg=",
"owner": "sainnhe",
"repo": "gruvbox-material",
"rev": "23371661bac2b7fdd9769c685e4224990c3b9ab8",
"type": "github"
},
"original": {
"owner": "sainnhe",
"repo": "gruvbox-material",
"type": "github"
}
},
"helix": {
"inputs": {
"crane": "crane",
@ -505,16 +557,17 @@
"home-manager_3": {
"inputs": {
"nixpkgs": [
"ookvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1720734513,
"narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=",
"lastModified": 1719588253,
"narHash": "sha256-A03i8xiVgP14DCmV5P7VUv37eodCjY4e1iai0b2EuuM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "90ae324e2c56af10f20549ab72014804a3064c7f",
"rev": "7e68e55d2e16d3a1e92a679430728c35a30fd24e",
"type": "github"
},
"original": {
@ -1092,16 +1145,17 @@
"nix-darwin": {
"inputs": {
"nixpkgs": [
"ookvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1720845312,
"narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=",
"lastModified": 1719128254,
"narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc",
"rev": "50581970f37f06a4719001735828519925ef8310",
"type": "github"
},
"original": {
@ -1267,6 +1321,18 @@
"type": "github"
}
},
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1717284937,
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
}
},
"nixpkgs-small": {
"locked": {
"lastModified": 1721481798,
@ -1284,6 +1350,38 @@
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1719506693,
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": {
"lastModified": 1719506693,
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_12": {
"locked": {
"lastModified": 1720031269,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
@ -1299,7 +1397,7 @@
"type": "github"
}
},
"nixpkgs_11": {
"nixpkgs_13": {
"locked": {
"lastModified": 1720955038,
"narHash": "sha256-GaliJqfFwyYxReFywxAa8orCO+EnDq2NK2F+5aSc8vo=",
@ -1447,21 +1545,19 @@
"inputs": {
"devshell": "devshell_2",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts_4",
"flake-parts": "flake-parts_5",
"git-hooks": "git-hooks",
"home-manager": "home-manager_3",
"nix-darwin": "nix-darwin",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs": "nixpkgs_11",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1721421992,
"narHash": "sha256-4Mu+O2/S5XU1D8HLTU53pv20hEH6aiTkUqjLHowYdY8=",
"lastModified": 1719768179,
"narHash": "sha256-gS+EB9iYftAxcnaMM648Ht/JGMocfRctBJh3yGAslUM=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "e80a8874accd45cac90616a7b5faa49c5a68e6b9",
"rev": "1391a64cf6f216315a6ce904db7144949585839a",
"type": "github"
},
"original": {
@ -1524,6 +1620,38 @@
"type": "gitlab"
}
},
"nvim-hl-md": {
"flake": false,
"locked": {
"lastModified": 1682765089,
"narHash": "sha256-uGn2RcyYhla0nY9Jyn5FIcvaZjd6i9EPAQ+5UuPKumU=",
"owner": "yaocccc",
"repo": "nvim-hl-mdcodeblock.lua",
"rev": "a652470bfed791d5026f6a35bacdfe90a9d8ac2f",
"type": "github"
},
"original": {
"owner": "yaocccc",
"repo": "nvim-hl-mdcodeblock.lua",
"type": "github"
}
},
"nvim-md": {
"flake": false,
"locked": {
"lastModified": 1717236659,
"narHash": "sha256-tZQpioTsVwMO+rnqsid0d1F1Tbpc8IQXY8+HPWbNoak=",
"owner": "ixru",
"repo": "nvim-markdown",
"rev": "bf5c87788156f072cfb87b994844424b164b5b44",
"type": "github"
},
"original": {
"owner": "ixru",
"repo": "nvim-markdown",
"type": "github"
}
},
"ooks-scripts": {
"inputs": {
"nixpkgs": "nixpkgs_9"
@ -1542,6 +1670,29 @@
"type": "github"
}
},
"ookvim": {
"inputs": {
"flake-parts": "flake-parts_4",
"gruvbox-material": "gruvbox-material",
"nixpkgs": "nixpkgs_10",
"nixvim": "nixvim",
"nvim-hl-md": "nvim-hl-md",
"nvim-md": "nvim-md"
},
"locked": {
"lastModified": 1721533991,
"narHash": "sha256-4Tbn5+5jD5qzGs61thDgy6GcAJmIMzTvFAJFurGHUgo=",
"ref": "refs/heads/master",
"rev": "3e6b2442f370b5063b49abe77dd8bce3a604b477",
"revCount": 26,
"type": "git",
"url": "ssh://git@github.com/ooks-io/ookvim"
},
"original": {
"type": "git",
"url": "ssh://git@github.com/ooks-io/ookvim"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@ -1562,8 +1713,8 @@
"nixarr": "nixarr",
"nixpkgs": "nixpkgs_8",
"nixpkgs-small": "nixpkgs-small",
"nixvim": "nixvim",
"ooks-scripts": "ooks-scripts",
"ookvim": "ookvim",
"systems": "systems_10",
"xdg-portal-hyprland": "xdg-portal-hyprland",
"zjstatus": "zjstatus"
@ -1875,16 +2026,17 @@
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"ookvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1720818892,
"narHash": "sha256-f52x9srIcqQm1Df3T+xYR5P6VfdnDFa2vkkcLhlTp6U=",
"lastModified": 1719243788,
"narHash": "sha256-9T9mSY35EZSM1KAwb7K9zwQ78qTlLjosZgtUGnw4rn4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "5b002f8a53ed04c1a4177e7b00809d57bd2c696f",
"rev": "065a23edceff48f948816b795ea8cc6c0dee7cdf",
"type": "github"
},
"original": {
@ -1919,7 +2071,7 @@
"inputs": {
"hyprland-protocols": "hyprland-protocols_2",
"hyprlang": "hyprlang_5",
"nixpkgs": "nixpkgs_10",
"nixpkgs": "nixpkgs_12",
"systems": "systems_12"
},
"locked": {
@ -1970,7 +2122,7 @@
"inputs": {
"crane": "crane_2",
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_11",
"nixpkgs": "nixpkgs_13",
"rust-overlay": "rust-overlay_3"
},
"locked": {

View file

@ -93,10 +93,7 @@
};
# neovim configured with nix
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
ookvim.url = "git+ssh://git@github.com/ooks-io/ookvim";
# packaged firefox addons
firefox-addons = {

View file

@ -1,37 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
inherit (config.colorscheme) slug;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim = {
colorschemes.base16 = {
enable = true;
colorscheme = "${slug}";
# colorscheme = {
# base00 = "#${palette.base00}";
# base01 = "#${palette.base01}";
# base02 = "#${palette.base02}";
# base03 = "#${palette.base03}";
# base04 = "#${palette.base04}";
# base05 = "#${palette.base05}";
# base06 = "#${palette.base06}";
# base07 = "#${palette.base07}";
# base08 = "#${palette.base08}";
# base09 = "#${palette.base09}";
# base0A = "#${palette.base0A}";
# base0B = "#${palette.base0B}";
# base0C = "#${palette.base0C}";
# base0D = "#${palette.base0D}";
# base0E = "#${palette.base0E}";
# base0F = "#${palette.base0F}";
# };
};
};
};
}

View file

@ -1,36 +1,16 @@
{ config, lib, inputs, ... }:
{ config, lib, inputs, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
ookvim = inputs.ookvim.packages.${pkgs.system}.default;
in
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
./settings.nix
./keymapping.nix
./plugins
./colorscheme.nix
];
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.neovim = {
viAlias = true;
vimAlias = true;
};
programs.nixvim = {
enable = true;
plugins = {
which-key = {
enable = true;
keyLabels = {
" " = "<space>";
};
};
};
};
home.packages = [ ookvim ];
};
}

View file

@ -1,25 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = [
{
mode = "n";
key = "<leader>f";
action = "+find/file";
}
];
};
};
}

View file

@ -1,12 +0,0 @@
{
imports = [
./indent.nix
./telescope.nix
./lualine.nix
./lsp.nix
./noice.nix
./nvim-autopairs.nix
./vim-nix.nix
./treesitter.nix
];
}

View file

@ -1,15 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim.plugins.indent-blankline = {
enable = true;
};
};
}

View file

@ -1,38 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim.plugins = {
lsp-lines.enable = true;
lsp = {
enable = true;
capabilities = "offsetEncoding = 'utf-16'";
servers = {
# nix
nil-ls = {
enable = true;
};
# markdown
marksman = {
enable = true;
};
# css
cssls = {
enable = true;
};
# c/c++
clangd = {
enable = true;
};
};
};
};
};
}

View file

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

View file

@ -1,19 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim.plugins.noice = {
enable = true;
presets = {
bottom_search = true;
command_palette = true;
};
};
};
}

View file

@ -1,15 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim.plugins.nvim-autopairs = {
enable = true;
};
};
}

View file

@ -1,41 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
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";
};
defaults = {
file_ignore_patterns = [
"^.git/"
"^data/"
];
set_env.COLORTERM = "truecolor";
};
};
};
};
}

View file

@ -1,15 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim.plugins.treesitter = {
enable = true;
};
};
}

View file

@ -1,15 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim.plugins.nix = {
enable = true;
};
};
}

View file

@ -1,100 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.editor.nvim;
console = config.ooknet.console;
in
{
config = mkIf (cfg.enable || console.editor == "nvim") {
programs.nixvim = {
opts = {
# line numbers
relativenumber = true;
number = true;
# command line height
cmdheight = 2;
# popup menu height (0 == use all available space)
pumheight = 0;
hidden = true;
# mouse mode
mouse = "a";
mousemodel = "extend";
# undo history
undofile = true;
swapfile = false;
backup = false;
# tab size
tabstop = 2;
expandtab = true;
showtabline = 2;
softtabstop = 2;
# auto indenting
smartindent = true;
shiftwidth = 2;
# text wrapping
wrap = true;
# fold settings
foldcolumn = "0";
foldlevel = 99;
foldlevelstart = 99;
foldenable = true;
# which-key timeout
timeoutlen = 10;
# faster updatetime
updatetime = 50;
# cursor position unless at start/end
scrolloff = 8;
# 24 bit colors
termguicolors = true;
# highlight cursor line
cursorline = true;
# encoding
encoding = "utf-8";
fileencoding = "utf-8";
# chars list
# list = true;
# listchars = "eol:↲,tab:|->,lead:·,space: ,trail:•,extends:→,precedes:←,nbsp:␣";
# splitting
splitbelow = true;
splitright = true;
# better searching
ignorecase = true;
grepprg = "rg --vimgrep";
grepformat = "%f:%l:%c:%m";
smartcase = true;
# prevent screen jumping
signcolumn = "yes";
incsearch = true;
autoindent = true;
};
clipboard = {
register = "unnamedplus";
providers.wl-copy.enable = true;
};
};
};
}