feat: add nix for formatting
All checks were successful
/ check (treefmt) (push) Successful in 3s
/ check-renovaterc (push) Successful in 2s
/ report-size (push) Successful in 2s

Also adds CI tests!
This commit is contained in:
Jalil David Salamé Messina 2025-03-10 22:58:18 +01:00
parent 58249e9ad0
commit 73142cfab8
Signed by: jalil
GPG key ID: F016B9E770737A0B
9 changed files with 314 additions and 121 deletions

43
flake.nix Normal file
View file

@ -0,0 +1,43 @@
{
description = "Description for the project";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.treefmt-nix.flakeModule ];
systems = import inputs.systems;
perSystem =
{ pkgs, ... }:
{
# Export pkgs.hello so we can test this action
packages = { inherit (pkgs) hello; };
# Setup formatters
treefmt = {
# Ignore images
settings.global.excludes = [ "*.png" ];
projectRootFile = "flake.nix";
programs = {
mdformat.enable = true;
nixfmt.enable = true;
shfmt.enable = true;
shellcheck.enable = true;
statix.enable = true;
typos.enable = true;
yamlfmt.enable = true;
};
};
};
};
}