move treefmt to tests flake

this way we don't polute our consumers flake.lock with treefmt
This commit is contained in:
Jörg Thalheim
2025-07-01 19:13:17 +02:00
parent fe49c326d5
commit a7600cef40
6 changed files with 51 additions and 86 deletions

23
tests/flake.lock generated
View File

@@ -74,7 +74,28 @@
"flake-parts": "flake-parts",
"nixos-hardware": "nixos-hardware",
"nixos-stable": "nixos-stable",
"nixos-unstable-small": "nixos-unstable-small"
"nixos-unstable-small": "nixos-unstable-small",
"treefmt-nix": "treefmt-nix"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixos-unstable-small"
]
},
"locked": {
"lastModified": 1750931469,
"narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},

View File

@@ -8,11 +8,16 @@
nixos-hardware.url = "github:NixOS/nixos-hardware";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixos-unstable-small";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixos-unstable-small";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.treefmt-nix.flakeModule
];
systems = [
"aarch64-linux"
"x86_64-linux"
@@ -85,6 +90,24 @@
in
{
_module.args.pkgs = nixpkgsUnstable;
treefmt = {
projectRootFile = "COPYING";
programs = {
deadnix = {
enable = true;
no-lambda-pattern-names = true;
};
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
};
settings = {
on-unmatched = "info";
};
};
checks =
checksForNixpkgs "nixos-unstable" nixpkgsUnstable
// checksForNixpkgs "nixos-stable" nixpkgsStable;