summaryrefslogtreecommitdiff
path: root/nix/package/nixfmt-3-space.nix
blob: 505d71e5530c847dbb826d44d4851cf4f16abd69 (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
#──────────────────────────────────────────────────────────────────────────────┐
# SPDX-FileCopyrightText: 2025 toastal <https://toast.al/contact/>             │
# SPDX-License-Identifier: LGPL-2.1-or-later                                   │
#──────────────────────────────────────────────────────────────────────────────┘
{
   lib,
   writeDashBinScript,
   nixfmt-rfc-style,
}:

writeDashBinScript {
   name = "nixfmt";
   text = /* sh */ ''
      exec ${lib.getExe nixfmt-rfc-style} --indent="3" "$@"
   '';
   meta = {
      description = "nixfmt, but with 3-space indentation";
      longDescription = ''
         I don’t like *this* formatter, but it is *a* formatter. Tweaking it to
         expand to 3 spaces, helps the maker actually read the code since 2
         spaces is not enough contrast (& Nix magic strings don’t support tabs).
      '';
   };
}