This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
treefmt/nix/packages.nix
Brian McGee 15db7f459c fix: duplicate processing in ordered formatters (#24)
Fixes a bug with formatters processing paths out of order.

Signed-off-by: Brian McGee <brian@bmcgee.ie>

Reviewed-on: #24
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
2024-01-12 15:15:51 +00:00

52 lines
1.1 KiB
Nix

{inputs, ...}: {
imports = [
inputs.flake-parts.flakeModules.easyOverlay
];
perSystem = {
self',
inputs',
lib,
pkgs,
...
}: {
packages = rec {
treefmt = inputs'.gomod2nix.legacyPackages.buildGoApplication rec {
pname = "treefmt";
version = "0.0.1+dev";
# ensure we are using the same version of go to build with
inherit (pkgs) go;
src = ../.;
modules = ../gomod2nix.toml;
ldflags = [
"-X 'build.Name=${pname}'"
"-X 'build.Version=${version}'"
];
nativeBuildInputs =
# we need some formatters available for the tests
import ./formatters.nix pkgs;
preCheck = ''
XDG_CACHE_HOME=$(mktemp -d)
export XDG_CACHE_HOME
'';
meta = with lib; {
description = "treefmt: one CLI to format your repo";
homepage = "https://git.numtide.com/numtide/treefmt";
license = licenses.mit;
mainProgram = "treefmt";
};
};
default = treefmt;
};
overlayAttrs = self'.packages;
};
}