1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

formatter: remove script, add treefmt.toml + keep-sorted (#7056)

currently ./format does a bunch of stuff with git that was only necessary for nixfmt but not nixfmt-tree, so I deleted it (just use treefmt command directly instead). I also added keep sorted to keep the really long module lists sorted (already used in nixpkgs).
This commit is contained in:
awwpotato 2025-05-20 10:42:51 -07:00 committed by GitHub
parent 559f6d36b3
commit 3f591550a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 494 additions and 503 deletions

View file

@ -45,22 +45,25 @@
}
// (
let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
forAllPkgs =
f:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: f nixpkgs.legacyPackages.${system});
in
{
formatter = forAllSystems (
system:
nixpkgs.legacyPackages.${system}.nixfmt-tree.override {
settings = {
tree-root-file = "release.json";
};
formatter = forAllPkgs (
pkgs:
pkgs.treefmt.withConfig {
runtimeInputs = with pkgs; [
nixfmt-rfc-style
keep-sorted
];
settings = pkgs.lib.importTOML ./treefmt.toml;
}
);
packages = forAllSystems (
system:
packages = forAllPkgs (
pkgs:
let
pkgs = nixpkgs.legacyPackages.${system};
releaseInfo = nixpkgs.lib.importJSON ./release.json;
docs = import ./docs {
inherit pkgs;