Skip to content

Commit

Permalink
hooks: declare nixpkgs-fmt pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nrdxp committed Dec 30, 2020
1 parent 28e4735 commit a0b9f9f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/nix-community/nixpkgs-fmt
rev: master
hooks:
- id: nixpkgs-fmt
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/blockchains/miningcore/deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ let
inherit sha256;
url = "${nugetUrlBase}/${name}/${version}";
};
in [
in
[

(fetchNuGet {
name = "Microsoft.AspNetCore.App.Runtime.linux-x64";
Expand Down
6 changes: 6 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pkgs.mkDevShell {
nixos-install
nixos-generate-config
nixos-enter
pre-commit
];

env = { inherit name; };
Expand All @@ -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;
Expand Down

1 comment on commit a0b9f9f

@blaggacao
Copy link
Contributor

@blaggacao blaggacao commented on a0b9f9f Jan 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the longer run: what do you personally think of numtide/devshell#19 ?

pre-commit is nice, but also a little complex to handle

devshell would kind of be an ideal candidate for adding value and cohesion to this end...

Please sign in to comment.