From 51befd63c2db4d26d48b8b6bbddae994765a16f3 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 14 Jun 2022 14:59:39 -0500 Subject: [PATCH 1/2] add: conform to support commit-disciline --- commit-msg.sh | 3 +++ flake.lock | 6 +++--- flake.nix | 13 ++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 commit-msg.sh diff --git a/commit-msg.sh b/commit-msg.sh new file mode 100644 index 0000000..10e0c9e --- /dev/null +++ b/commit-msg.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +conform enforce --commit-msg-file \$1 diff --git a/flake.lock b/flake.lock index fa9c5cd..baafdb9 100644 --- a/flake.lock +++ b/flake.lock @@ -668,11 +668,11 @@ }, "nixpkgs_13": { "locked": { - "lastModified": 1648219316, - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "lastModified": 1655211057, + "narHash": "sha256-Zs5wm2GuW2nER9uYpgAAxuEqEK3LTo3Y+lwaWn/YYHk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "rev": "1712ecaa5118815292f57d6669c3c81d84d842b3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8a9cc7e..c69a548 100644 --- a/flake.nix +++ b/flake.nix @@ -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 + ]; }; # -------------------------------------- From aed03e4adf3cb2a3d8d388422a1b97fc04c8ac02 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 19 Jun 2022 13:59:23 -0500 Subject: [PATCH 2/2] doc: expand minimal readme to (minimal +1) --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 21979ae..41c4139 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,18 @@ --- -It is forbidden to modify this readme → read the comments in flake.nix! +_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. + +For more details: → read the comments in flake.nix! + +[devshell]: https://github.com/numtide/devshell