{ perSystem = { config, lib, pkgs, ... }: { apps.checks = { type = "app"; program = toString ( pkgs.writeShellScript "lint" '' set -e "${pkgs.nix-fast-build}/bin/nix-fast-build" --skip-cached --no-link "$@" '' ); 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"; }; }; }