aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2022-06-10 12:22:55 -0600
committerCody Hiar <cody@hiar.ca>2022-06-10 12:22:55 -0600
commitd1c821eced6e1ae02b4e0b303cd8388d38e6943c (patch)
tree75700f586d4b6338a2bb3a52161c1f447524b833
parent1dfb0beddb27cd5420214f875f484621ac86bdb6 (diff)
Add nix linting and fixing
-rw-r--r--flake.nix8
-rw-r--r--init.lua3
-rw-r--r--nix/flake8-isort.nix1
-rw-r--r--nix/mypython.nix1
-rw-r--r--nix/vale.nix1
5 files changed, 10 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index 00d34bc..a062e6d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,9 +1,7 @@
{
description = "My Completely Inelegant Neovim Flake";
- inputs = {
- nixpkgs.url = "nixpkgs/nixos-unstable";
- };
+ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs, ... }@inputs:
let
@@ -23,7 +21,8 @@
# Python with linting and such
mypython = super.python3Packages.callPackage ./nix/mypython.nix { };
# Wasn't packaged
- vim-angry-reviewer = super.callPackage ./nix/vim-angry-reviewer.nix { };
+ vim-angry-reviewer =
+ super.callPackage ./nix/vim-angry-reviewer.nix { };
})
];
};
@@ -112,6 +111,7 @@
nodePackages.bash-language-server
shellcheck
hadolint
+ nixfmt
]
}
makeWrapper ${myneovim}/bin/nvim $out/bin/nvim --prefix PATH : $BINPATH
diff --git a/init.lua b/init.lua
index f3a8e9c..eeb0382 100644
--- a/init.lua
+++ b/init.lua
@@ -314,17 +314,20 @@ require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
-- ale
vim.g.ale_lint_on_save = 1
+vim.g.ale_fix_on_save = 1
vim.g.ale_linters = {
sh = { "shellcheck", },
python = { "flake8" },
dockerfile = { "hadolint" },
terraform = { "terraform_ls" },
markdown = { "vale" },
+ nix = { "nix" },
}
vim.g.ale_fixers = {
sh = { "shfmt", },
python = { "isort", "black" },
terraform = { "terraform" },
+ nix = { "nixfmt" },
}
vim.cmd([[
autocmd BufRead *.py :ALEFix
diff --git a/nix/flake8-isort.nix b/nix/flake8-isort.nix
index ce27161..385e4f7 100644
--- a/nix/flake8-isort.nix
+++ b/nix/flake8-isort.nix
@@ -1,4 +1,5 @@
{ buildPythonPackage, fetchPypi, python3Packages }:
+
buildPythonPackage rec {
pname = "flake8-isort";
version = "4.1.1";
diff --git a/nix/mypython.nix b/nix/mypython.nix
index 9906fa7..524ec51 100644
--- a/nix/mypython.nix
+++ b/nix/mypython.nix
@@ -1,4 +1,5 @@
{ python3, flake8-isort }:
+
let
my-python-packages = python-packages:
with python-packages; [
diff --git a/nix/vale.nix b/nix/vale.nix
index c1fd15d..f33b2ba 100644
--- a/nix/vale.nix
+++ b/nix/vale.nix
@@ -1,4 +1,5 @@
{ lib, buildGoModule, fetchFromGitHub }:
+
buildGoModule rec {
pname = "vale";
version = "2.17.0";