2024-07-08 14:05:15 +00:00
|
|
|
{ inputs, ... }:
|
2024-03-17 18:48:49 +00:00
|
|
|
{
|
|
|
|
imports = [ inputs.treefmt-nix.flakeModule ];
|
|
|
|
perSystem =
|
|
|
|
{ self', pkgs, ... }:
|
|
|
|
{
|
2024-07-09 11:49:42 +00:00
|
|
|
treefmt.projectRootFile = ".git/config";
|
2024-03-17 18:48:49 +00:00
|
|
|
treefmt.programs.shellcheck.enable = true;
|
2023-08-23 10:32:06 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
treefmt.programs.mypy.enable = true;
|
2024-07-08 14:05:15 +00:00
|
|
|
treefmt.programs.nixfmt.enable = true;
|
|
|
|
treefmt.programs.nixfmt.package = pkgs.nixfmt-rfc-style;
|
|
|
|
treefmt.programs.deadnix.enable = true;
|
|
|
|
|
2024-07-19 20:20:12 +00:00
|
|
|
treefmt.programs.mypy.directories =
|
|
|
|
{
|
|
|
|
"pkgs/clan-cli" = {
|
|
|
|
extraPythonPackages = self'.packages.clan-cli.testDependencies;
|
|
|
|
modules = [ "clan_cli" ];
|
|
|
|
};
|
|
|
|
"pkgs/clan-app" = {
|
|
|
|
extraPythonPackages =
|
|
|
|
# clan-app currently only exists on linux
|
|
|
|
(self'.packages.clan-app.externalTestDeps or [ ]) ++ self'.packages.clan-cli.testDependencies;
|
|
|
|
modules = [ "clan_app" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// (
|
|
|
|
if pkgs.stdenv.isLinux then
|
|
|
|
{
|
|
|
|
"pkgs/clan-vm-manager" = {
|
|
|
|
extraPythonPackages =
|
|
|
|
# clan-app currently only exists on linux
|
|
|
|
self'.packages.clan-vm-manager.testDependencies ++ self'.packages.clan-cli.testDependencies;
|
|
|
|
modules = [ "clan_vm_manager" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ }
|
|
|
|
);
|
2024-07-08 14:05:15 +00:00
|
|
|
treefmt.programs.ruff.check = true;
|
|
|
|
treefmt.programs.ruff.format = true;
|
2023-08-23 10:32:06 +00:00
|
|
|
|
2024-06-30 06:17:04 +00:00
|
|
|
# FIXME: currently broken in CI
|
|
|
|
#treefmt.settings.formatter.vale =
|
|
|
|
# let
|
|
|
|
# vocab = "cLAN";
|
|
|
|
# style = "Docs";
|
|
|
|
# config = pkgs.writeText "vale.ini" ''
|
|
|
|
# StylesPath = ${styles}
|
|
|
|
# Vocab = ${vocab}
|
2024-05-15 16:37:05 +00:00
|
|
|
|
2024-06-30 06:17:04 +00:00
|
|
|
# [*.md]
|
|
|
|
# BasedOnStyles = Vale, ${style}
|
|
|
|
# Vale.Terms = No
|
|
|
|
# '';
|
|
|
|
# styles = pkgs.symlinkJoin {
|
|
|
|
# name = "vale-style";
|
|
|
|
# paths = [
|
|
|
|
# accept
|
|
|
|
# headings
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
# accept = pkgs.writeTextDir "config/vocabularies/${vocab}/accept.txt" ''
|
|
|
|
# Nix
|
|
|
|
# NixOS
|
|
|
|
# Nixpkgs
|
|
|
|
# clan.lol
|
|
|
|
# Clan
|
|
|
|
# monorepo
|
|
|
|
# '';
|
|
|
|
# headings = pkgs.writeTextDir "${style}/headings.yml" ''
|
|
|
|
# extends: capitalization
|
|
|
|
# message: "'%s' should be in sentence case"
|
|
|
|
# level: error
|
|
|
|
# scope: heading
|
|
|
|
# # $title, $sentence, $lower, $upper, or a pattern.
|
|
|
|
# match: $sentence
|
|
|
|
# '';
|
|
|
|
# in
|
|
|
|
# {
|
|
|
|
# command = "${pkgs.vale}/bin/vale";
|
|
|
|
# options = [ "--config=${config}" ];
|
|
|
|
# includes = [ "*.md" ];
|
|
|
|
# # TODO: too much at once, fix piecemeal
|
|
|
|
# excludes = [
|
|
|
|
# "docs/*"
|
|
|
|
# "clanModules/*"
|
|
|
|
# "pkgs/*"
|
|
|
|
# ];
|
|
|
|
# };
|
2023-07-21 09:21:09 +00:00
|
|
|
};
|
2023-07-12 17:00:09 +00:00
|
|
|
}
|