summaryrefslogtreecommitdiff
path: root/nix/overlay/check.nix
blob: 8a6ec2b9fe35c6b4b8f46c1733b17cd02101997d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
                  '';
         };
      }
   );
}