Skip to content

add: conform to support commit-disciline #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,18 @@

---

<sub>It is forbidden to modify this readme &rarr; read the comments in <a href="flake.nix"><code>flake.nix</code></a>!</sub>
_A collection of common devshell modules specified via [`numtide/devshell`][devshell]._

## Why?

- Avoid repetition and reuse common best practices.
- Provide a collection of components to "kill the toil" in the devshell in different scenarios.
- Integrate DevShell concerns with the wider config management in `nix`: cross-reference variables.

## Usage

This is a prototype: consult usage with your Resident SRE.

<sub>For more details: &rarr; read the comments in <a href="flake.nix"><code>flake.nix</code></a>!</sub>

[devshell]: https://github.com/numtide/devshell
3 changes: 3 additions & 0 deletions commit-msg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

conform enforce --commit-msg-file \$1
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@
# --------------------------------------
# Hooks: use the default company-wide git hooks
# --------------------------------------
hooks = {extraModulesPath, ...}: {
hooks = {
extraModulesPath,
pkgs,
...
}: let
nixpkgs' = nixpkgs.${pkgs.system};
in {
inherit _file;
imports = ["${extraModulesPath}/git/hooks.nix"];
git.hooks.enable = true;
git.hooks.pre-commit.text = builtins.readFile ./pre-commit.sh;
git.hooks.commit-msg.text = builtins.readFile ./commit-msg.sh;
packages = with nixpkgs'; [
conform
editorconfig-checker
];
};

# --------------------------------------
Expand Down