Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2024-05-13 12:47:39 +02:00
{
lib,
buildGoModule,
callPackages,
2024-05-13 12:47:39 +02:00
fetchFromGitHub,
}:
buildGoModule rec {
pname = "treefmt";
2025-05-21 13:37:06 +01:00
version = "2.3.1";
2024-05-13 12:47:39 +02:00
src = fetchFromGitHub {
owner = "numtide";
repo = "treefmt";
rev = "v${version}";
2025-05-21 13:37:06 +01:00
hash = "sha256-Z1AGLaGrRrUd75aQJc/UKwzMGb9gI/p5WxQ5XUgp98o=";
2024-05-13 12:47:39 +02:00
};
2025-05-16 15:19:37 +01:00
vendorHash = "sha256-9yAvqz99YlBfFU/hGs1PB/sH0iOyWaVadqGhfXMkj5E=";
2024-05-13 12:47:39 +02:00
subPackages = [ "." ];
env.CGO_ENABLED = 1;
2024-05-13 12:47:39 +02:00
ldflags = [
"-s"
"-w"
2024-11-29 14:52:24 +00:00
"-X github.com/numtide/treefmt/v2/build.Name=treefmt"
"-X github.com/numtide/treefmt/v2/build.Version=v${version}"
2024-05-13 12:47:39 +02:00
];
passthru = {
inherit (callPackages ./lib.nix { })
evalConfig
withConfig
buildConfig
;
tests = callPackages ./tests.nix { };
# Documentation for functions defined in `./lib.nix`
functionsDoc = callPackages ./functions-doc.nix { };
# Documentation for options declared in `treefmt.evalConfig` configurations
optionsDoc = callPackages ./options-doc.nix { };
};
2024-05-13 12:47:39 +02:00
meta = {
description = "One CLI to format the code tree";
longDescription = ''
[treefmt](${meta.homepage}) streamlines the process of applying formatters
to your project, making it a breeze with just one command line.
The `treefmt` package provides functions for configuring treefmt using
the module system, which are documented in the [treefmt section] of the
Nixpkgs Manual.
Alternatively, treefmt can be configured using [treefmt-nix].
[treefmt section]: https://nixos.org/manual/nixpkgs/unstable#treefmt
[treefmt-nix]: https://github.com/numtide/treefmt-nix
'';
2024-05-13 12:47:39 +02:00
homepage = "https://github.com/numtide/treefmt";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
brianmcgee
MattSturgeon
zimbatm
2024-05-13 12:47:39 +02:00
];
mainProgram = "treefmt";
};
}