diff options
author | Cody Hiar <cody@hiar.ca> | 2022-06-05 13:47:31 -0600 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2022-06-05 13:47:31 -0600 |
commit | 164704220b09e0f18f8be918f9fde025355f0dcd (patch) | |
tree | 35bf069bdee8b3b992a5757b1d3726a31d780f76 | |
parent | d134dd7d77ad55442bf9b5e4b62361e9fcf3e198 (diff) |
Get a basic flake set up
-rw-r--r-- | flake.lock | 26 | ||||
-rw-r--r-- | flake.nix | 42 | ||||
-rw-r--r-- | init.lua | 15 | ||||
-rw-r--r-- | nix/flake8-isort.nix | 11 | ||||
-rw-r--r-- | nix/mypython.nix | 13 | ||||
-rw-r--r-- | nix/vale.nix | 20 |
6 files changed, 127 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c00c3dd --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1654230545, + "narHash": "sha256-8Vlwf0x8ow6pPOK2a04bT+pxIeRnM1+O0Xv9/CuDzRs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "236cc2971ac72acd90f0ae3a797f9f83098b17ec", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..87fffd5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "My Completely Inelegant Neovim Flake"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + overlays = [ + (self: super: { + vale = super.callPackage ./nix/vale.nix { }; + flake8-isort = super.python3Packages.callPackage ./nix/flake8-isort.nix { }; + mypython = super.python3Packages.callPackage ./nix/mypython.nix { }; + }) + ]; + }; + in { + packages.${system}.neovimCH = with pkgs; symlinkJoin { + name = "neovim"; + paths = [ pkgs.neovim ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = with pkgs; '' + rm $out/bin/nvim + BINPATH=${lib.makeBinPath [ + nodejs + mypython + pyright + vale + tree-sitter + nodePackages.bash-language-server + shellcheck + hadolint + ]} + makeWrapper ${neovim}/bin/nvim $out/bin/nvim --prefix PATH : $BINPATH + ''; + }; + }; +} @@ -103,6 +103,8 @@ vim.api.nvim_set_keymap('n', '<leader>cp', "<cmd>cprev<cr>", { noremap = true }) vim.api.nvim_set_keymap('n', '<leader>cn', "<cmd>cnext<cr>", { noremap = true }) vim.api.nvim_set_keymap('n', '<leader>lp', "<cmd>lprev<cr>", { noremap = true }) vim.api.nvim_set_keymap('n', '<leader>ln', "<cmd>lnext<cr>", { noremap = true }) +vim.api.nvim_set_keymap('n', '<leader>lo', "<cmd>lopen<cr>", { noremap = true }) +vim.api.nvim_set_keymap('n', '<leader>lc', "<cmd>lclose<cr>", { noremap = true }) -- Visually select line without ending vim.api.nvim_set_keymap('n', '<leader>v', '^v$h', { noremap = true }) -- Ledger Shortcuts @@ -387,11 +389,15 @@ return require('packer').startup(function() use { 'dense-analysis/ale', config = function() + -- vim.g.ale_set_quickfix = 1 + -- vim.g.ale_open_list = 1 + vim.g.ale_lint_on_save = 1 vim.g.ale_linters = { sh = { "shellcheck", }, python = { "flake8" }, dockerfile = { "hadolint" }, terraform = { "terraform_ls" }, + markdown = { "vale" }, } vim.g.ale_fixers = { sh = { "shfmt", }, @@ -412,6 +418,15 @@ return require('packer').startup(function() } use 'hashivim/vim-terraform' use { + 'anufrievroman/vim-angry-reviewer', + config = function() + vim.g.AngryReviewerEnglish = 'american' + vim.cmd([[ + autocmd BufWrite *.md :AngryReviewer + ]]) + end + } + use { 'mileszs/ack.vim', config = function() vim.cmd([[ diff --git a/nix/flake8-isort.nix b/nix/flake8-isort.nix new file mode 100644 index 0000000..385e4f7 --- /dev/null +++ b/nix/flake8-isort.nix @@ -0,0 +1,11 @@ +{ buildPythonPackage, fetchPypi, python3Packages }: + +buildPythonPackage rec { + pname = "flake8-isort"; + version = "4.1.1"; + src = fetchPypi { + inherit pname version; + sha256 = "2BQwSrcObliFm8XD4iHi5ucclY5wBSOSAv7hnCT4Jxc="; + }; + checkInputs = with python3Packages; [ flake8 isort pytest testfixtures ]; +} diff --git a/nix/mypython.nix b/nix/mypython.nix new file mode 100644 index 0000000..aa262d4 --- /dev/null +++ b/nix/mypython.nix @@ -0,0 +1,13 @@ +{ python3, flake8-isort }: + +let + my-python-packages = python-packages: with python-packages; [ + jedi-language-server + flake8 + flake8-isort + isort + black + ]; + mypython = python3.withPackages my-python-packages; +in +mypython diff --git a/nix/vale.nix b/nix/vale.nix new file mode 100644 index 0000000..396f0b7 --- /dev/null +++ b/nix/vale.nix @@ -0,0 +1,20 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "vale"; + version = "2.17.0"; + subPackages = [ "cmd/vale" ]; + outputs = [ "out" "data" ]; + src = fetchFromGitHub { + owner = "errata-ai"; + repo = "vale"; + rev = "v${version}"; + sha256 = "sha256-PUaIx6rEaLz0HUxkglsVHw0Kx/ovI2f4Yhknuysr5Gs="; + }; + vendorSha256 = "sha256-zdgLWEArmtHTDM844LoSJwKp0UGoAR8bHnFOSlrrjdg="; + postInstall = '' + mkdir -p $data/share/vale + cp -r styles $data/share/vale + ''; + ldflags = [ "-s" "-w" "-X main.version=${version}" ]; +} |