hooks: declare nixpkgs-fmt pre-commit hook

This commit is contained in:
Timothy DeHerrera 2020-12-30 01:47:42 -07:00
parent 28e473517d
commit a0b9f9ffe6
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
4 changed files with 16 additions and 2 deletions

5
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,5 @@
repos:
- repo: https://github.com/nix-community/nixpkgs-fmt
rev: master
hooks:
- id: nixpkgs-fmt

View File

@ -6,7 +6,9 @@ the `template` branch to provide a host of useful NixOS configurations available
"out of the box". If you wish to contribute such an expression please follow
these guidelines:
* format your code with [`nixpkgs-fmt`][nixpkgs-fmt]
* format your code with [`nixpkgs-fmt`][nixpkgs-fmt]. You can run the `hooks`
command inside the nix shell to install a pre-commit hook that does this
for you.
* The commit message follows the same semantics as [nixpkgs][nixpkgs].
* You can use a `#` symbol to specify ambiguities. For example,
`develop#zsh: <rest of commit message>` would tell me that your updating the

View File

@ -6,7 +6,8 @@ let
inherit sha256;
url = "${nugetUrlBase}/${name}/${version}";
};
in [
in
[
(fetchNuGet {
name = "Microsoft.AspNetCore.App.Runtime.linux-x64";

View File

@ -37,6 +37,7 @@ pkgs.mkDevShell {
nixos-install
nixos-generate-config
nixos-enter
pre-commit
];
env = { inherit name; };
@ -54,6 +55,11 @@ pkgs.mkDevShell {
category = "main";
package = flk;
}
{
name = "hooks";
help = "install git hooks";
command = "pre-commit install";
}
{
name = "grip";
help = python38Packages.grip.meta.description;