feat: add nix for formatting
Also adds CI tests!
This commit is contained in:
parent
58249e9ad0
commit
73142cfab8
9 changed files with 314 additions and 121 deletions
43
flake.nix
Normal file
43
flake.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue