From 06bedbe42e56079ddc15836eb50bb463c49f9d44 Mon Sep 17 00:00:00 2001 From: briquet Date: Thu, 24 Sep 2026 15:46:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(dev)=20enable=20gitlint=20as=20a?= =?UTF-8?q?=20commit-msg=20hook=20in=20the=20devenv=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit messages were only checked by the CI lint-git job, therefore any misformatting was caught only after pushing. --- .gitignore | 1 + devenv.lock | 45 ++++++++++++++++++++++++++++++++++++++++++--- devenv.nix | 2 ++ devenv.yaml | 5 +++++ 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0fb07cfa..c3acfbc1 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,4 @@ docker/livekit/rootCA.pem # NixOS .devenv +.pre-commit-config.yaml diff --git a/devenv.lock b/devenv.lock index 81f597ef..d7126ed4 100644 --- a/devenv.lock +++ b/devenv.lock @@ -18,12 +18,50 @@ "url": "https://github.com/cachix/devenv" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1790091288, + "narHash": "sha256-2dUuLTiQrf2gUFVLlayDq/hgluitplAMv6Y9bYwQQ+c=", + "ref": "refs/heads/master", + "rev": "0d3997c4d3253505f77c9bcea63904bb575da3c5", + "shallow": true, + "type": "git", + "url": "https://github.com/cachix/git-hooks.nix" + }, + "original": { + "shallow": true, + "type": "git", + "url": "https://github.com/cachix/git-hooks.nix" + } + }, "nixpkgs": { "locked": { - "lastModified": 1789542786, - "narHash": "sha256-ajQuqcxnj6RYnwCjA/9FTCnrdR2+BDzstE8UembXf60=", + "lastModified": 1790218706, + "narHash": "sha256-6e4Na3z008XpdVyOXgfasXIn1aN+z8AXFG+jXdQSyuI=", "ref": "nixos-26.05", - "rev": "4c7870105e7f1fdf9c48688c8d7efc21abf0688a", + "rev": "c508844df6c28fa6dabc1b6af70f3ccbd65c5201", "shallow": true, "type": "git", "url": "https://github.com/NixOS/nixpkgs" @@ -38,6 +76,7 @@ "root": { "inputs": { "devenv": "devenv", + "git-hooks": "git-hooks", "nixpkgs": "nixpkgs" } } diff --git a/devenv.nix b/devenv.nix index 5addcb19..1a31fa9f 100644 --- a/devenv.nix +++ b/devenv.nix @@ -101,6 +101,8 @@ in languages.typescript.enable = false; languages.nix.enable = true; + git-hooks.hooks.gitlint.enable = true; + packages = with pkgs; [ diff --git a/devenv.yaml b/devenv.yaml index 60520eef..5b852af0 100644 --- a/devenv.yaml +++ b/devenv.yaml @@ -3,3 +3,8 @@ inputs: url: git+https://github.com/NixOS/nixpkgs?ref=nixos-26.05&shallow=1 devenv: url: git+https://github.com/cachix/devenv?ref=refs/tags/v2.1.2&dir=src/modules + git-hooks: + url: git+https://github.com/cachix/git-hooks.nix?shallow=1 + inputs: + nixpkgs: + follows: nixpkgs