summaryrefslogtreecommitdiff
path: root/nix/overlay/check.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/overlay/check.nix')
-rw-r--r--nix/overlay/check.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nix/overlay/check.nix b/nix/overlay/check.nix
new file mode 100644
index 0000000..8a6ec2b
--- /dev/null
+++ b/nix/overlay/check.nix
@@ -0,0 +1,32 @@
+#──────────────────────────────────────────────────────────────────────────────┐
+# SPDX-FileCopyrightText: 2025 toastal <https://toast.al/contact/> │
+# SPDX-License-Identifier: LGPL-2.1-or-later │
+#──────────────────────────────────────────────────────────────────────────────┘
+final: prev: {
+ nixtamal = prev.nixtamal.overrideScope (
+ final': prev': {
+ check = (prev'.check or { }) // {
+ EditorConfig =
+ final.runCommand "check-EditorConfig"
+ {
+ src =
+ let
+ fs = final.lib.fileset;
+ in
+ (fs.toSource {
+ root = ../..;
+ fileset = fs.unions [
+ (fs.fileFilter (file: file.name == ".editorconfig") ../..)
+ (fs.fromSource prev'.nixtamal.src)
+ ../../nix
+ ];
+ });
+ }
+ ''
+ cd $src
+ ${final.lib.getExe final.editorconfig-checker} | tee $out
+ '';
+ };
+ }
+ );
+}