From 0d612063fb7c5f1d936e9c29a958115c81884071 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sat, 16 Aug 2025 15:37:11 +0700 Subject: [PATCH] chore: dogfood via check, not treefmt closes #121 --- flake-parts/dogfood.nix | 20 ++++++++++++++++++++ flake-parts/fmt.nix | 10 +--------- flake.nix | 1 + 3 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 flake-parts/dogfood.nix diff --git a/flake-parts/dogfood.nix b/flake-parts/dogfood.nix new file mode 100644 index 0000000..0a2cfa8 --- /dev/null +++ b/flake-parts/dogfood.nix @@ -0,0 +1,20 @@ +{ lib, root, ... }: +{ + partitions.dev.module.perSystem = + psArgs@{ pkgs, ... }: + let + src = lib.fileset.toSource { + inherit root; + fileset = lib.fileset.fileFilter (file: file.hasExt "nix") root; + }; + in + { + checks.dogfood = + pkgs.runCommand "dogfood" { nativeBuildInputs = [ psArgs.config.packages.default ]; } + '' + cd ${src} + statix check --ignore /bin/tests/data + touch $out + ''; + }; +} diff --git a/flake-parts/fmt.nix b/flake-parts/fmt.nix index 619b7d9..00c2265 100644 --- a/flake-parts/fmt.nix +++ b/flake-parts/fmt.nix @@ -9,21 +9,13 @@ treefmt = { projectRootFile = "flake.nix"; programs = { - nixfmt = { - enable = true; - priority = 2; - }; + nixfmt.enable = true; prettier.enable = true; # https://github.com/pappasam/toml-sort/issues/62 # toml-sort = { # enable = true; # all = true; # }; - statix = { - enable = true; - priority = 1; - package = psArgs.config.packages.statix; - }; }; settings.on-unmatched = "fatal"; }; diff --git a/flake.nix b/flake.nix index eb62609..c757c66 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,7 @@ ./flake-parts/ci.nix ./flake-parts/dependabot.nix ./flake-parts/dev-shell.nix + ./flake-parts/dogfood.nix ./flake-parts/files.nix ./flake-parts/fmt.nix ./flake-parts/git-hooks.nix -- 2.51.2