summaryrefslogtreecommitdiff
path: root/nix/check/editorconfig.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/check/editorconfig.nix')
-rw-r--r--nix/check/editorconfig.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nix/check/editorconfig.nix b/nix/check/editorconfig.nix
new file mode 100644
index 0000000..526ed5b
--- /dev/null
+++ b/nix/check/editorconfig.nix
@@ -0,0 +1,38 @@
+#──────────────────────────────────────────────────────────────────────────────┐
+# SPDX-FileCopyrightText: 2025 toastal <https://toast.al/contact/> │
+# SPDX-License-Identifier: LGPL-2.1-or-later │
+#──────────────────────────────────────────────────────────────────────────────┘
+{
+ lib,
+ runDashCommand,
+ editorconfig-checker,
+ nixtamal,
+}:
+
+runDashCommand
+ {
+ name = "check-EditorConfig";
+ runtimeInputs = [
+ editorconfig-checker
+ ];
+ env.src =
+ let
+ fs = lib.fileset;
+ in
+ (fs.toSource {
+ root = ../..;
+ fileset = fs.unions [
+ (fs.fileFilter (file: file.name == ".editorconfig") ../..)
+ (fs.fromSource nixtamal.src)
+ ../../nix
+ ];
+ });
+ }
+ /* sh */ ''
+ if [ -z "$src" ]; then
+ echo "Missing \$src" >&2
+ exit 1
+ fi
+ cd "$src"
+ editorconfig-checker | tee "$out"
+ ''