aboutsummaryrefslogtreecommitdiff
path: root/root
diff options
context:
space:
mode:
Diffstat (limited to 'root')
-rw-r--r--root/nix/apps.nix28
1 files changed, 27 insertions, 1 deletions
diff --git a/root/nix/apps.nix b/root/nix/apps.nix
index 7421234..e5d619e 100644
--- a/root/nix/apps.nix
+++ b/root/nix/apps.nix
@@ -1,6 +1,11 @@
{
perSystem =
- { pkgs, ... }:
+ {
+ config,
+ lib,
+ pkgs,
+ ...
+ }:
{
apps.checks = {
type = "app";
@@ -13,5 +18,26 @@
);
meta.description = "run all the nix checks in parallel";
};
+
+ apps.lint =
+ let
+ devshells = builtins.filter (n: n != "common") (builtins.attrNames config.devShells);
+ mkTreefmtCommand = name: "nix develop .#${name} --command treefmt";
+ quotedCommands = lib.strings.concatMapStringsSep " " (
+ n: lib.escapeShellArg (mkTreefmtCommand n)
+ ) devshells;
+ in
+ {
+ type = "app";
+ program = toString (
+ pkgs.writeShellScript "treefmt" ''
+ set -xeuo pipefail
+
+ ${pkgs.parallel}/bin/parallel -j5 -k ::: ${quotedCommands}
+ ''
+ );
+ meta.description = "run treefmt from all the projects in parallel";
+ };
+
};
}