nixfleet/checks/default.nix
Andrea Ciceri 159e7a7c72
All checks were successful
/ test (push) Successful in 1m23s
Make pre-commit re-use the same config for treefmt
2024-11-15 10:06:16 +01:00

43 lines
826 B
Nix

{
inputs,
self,
lib,
...
}:
{
imports = [
inputs.treefmt-nix.flakeModule
inputs.git-hooks-nix.flakeModule
];
perSystem =
{ config, ... }:
{
treefmt.config = {
projectRootFile = ".git/config";
flakeFormatter = true;
flakeCheck = true;
programs = {
nixfmt.enable = true;
};
};
pre-commit.settings = {
hooks.treefmt = {
enable = true;
package = config.treefmt.build.wrapper;
};
};
};
flake.checks =
let
build = _: nc: nc.config.system.build.toplevel;
in
{
x86_64-linux = lib.mapAttrs build { inherit (self.nixosConfigurations) picard; };
aarch64-linux = lib.mapAttrs build {
inherit (self.nixosConfigurations) sisko; # pbp;
};
};
}