Use nixpkgs-fmt hook from pre-commit-hooks.nix
This commit is contained in:
parent
1e8a7ee19f
commit
99c4de6d66
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/result
|
||||
/*.qcow2
|
||||
/.pre-commit-config.yaml
|
||||
/result
|
||||
|
|
11
default.nix
Normal file
11
default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
let
|
||||
nix-pre-commit-hooks = import (builtins.fetchTarball "https://github.com/cachix/pre-commit-hooks.nix/tarball/master");
|
||||
in
|
||||
{
|
||||
pre-commit-check = nix-pre-commit-hooks.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
nixpkgs-fmt --check .
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs ? import <nixpkgs> { } }:
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nixpkgs-fmt
|
||||
];
|
||||
buildPhase = ''
|
||||
ln -f -s ../../pre-commit-hook .git/hooks/pre-commit
|
||||
shellHook = ''
|
||||
${(import ./default.nix).pre-commit-check.shellHook}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue