Install pre-commit-hook
This commit is contained in:
parent
5a313a3420
commit
e80d63f7c2
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/configuration.nix
|
||||
/.pre-commit-config.yaml
|
||||
|
|
|
@ -5,5 +5,5 @@ let
|
|||
nvd = import pkgs.sources.nvd { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
home.activation.report-changes = dag.entryAnywhere "${nvd}/bin/nvd $oldGenPath $newGenPath";
|
||||
home.activation.report-changes = dag.entryAnywhere "${nvd}/bin/nvd diff $oldGenPath $newGenPath";
|
||||
}
|
||||
|
|
|
@ -117,6 +117,18 @@
|
|||
"url": "https://github.com/obsidiansystems/obelisk/archive/7ad33cbe3e84b209e83c505ce25486445bbd602e.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"pre-commit-hooks.nix": {
|
||||
"branch": "master",
|
||||
"description": "Seamless integration of https://pre-commit.com git hooks with Nix.",
|
||||
"homepage": "",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "40a51af82c1181b9dea3526c4124eee077e30213",
|
||||
"sha256": "0yi1vdi0bdfmwnzrmal103vb5sk9994h6894616ivrn0r3514kai",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/cachix/pre-commit-hooks.nix/archive/40a51af82c1181b9dea3526c4124eee077e30213.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"taskwarrior-git-backend": {
|
||||
"branch": "master",
|
||||
"description": "An experimental task-sync alternative via git written in Haskell",
|
||||
|
|
5
shell.nix
Normal file
5
shell.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
(import (import ./nix/sources.nix).nixos-unstable { }).mkShell {
|
||||
shellHook = ''
|
||||
${(import ./test.nix).pre-commit-check.shellHook}
|
||||
'';
|
||||
}
|
14
test.nix
Normal file
14
test.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
let
|
||||
nix-pre-commit-hooks = import (import ./nix/sources.nix)."pre-commit-hooks.nix";
|
||||
in
|
||||
{
|
||||
pre-commit-check = nix-pre-commit-hooks.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
hlint.enable = true;
|
||||
nixpkgs-fmt.enable = true;
|
||||
fourmolu.enable = true;
|
||||
shellcheck.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue