Files
Fabric/nix/treefmt.nix
Kayvan Sylvan ed87954133 chore: prevent Go toolchain auto-download by setting GOTOOLCHAIN=local environment variable
## CHANGES

- Add GOTOOLCHAIN=local to shell environment
- Configure preBuild hook in fabric package
- Wrap goimports with local toolchain setting
- Wrap gofmt with local toolchain setting
- Update treefmt module import structure
- Add pkgs parameter to treefmt config
- Create shell script wrappers for Go tools
2025-09-14 10:45:51 -07:00

26 lines
522 B
Nix

{ pkgs, ... }:
{
projectRootFile = "flake.nix";
programs = {
deadnix.enable = true;
statix.enable = true;
nixfmt.enable = true;
goimports = {
enable = true;
package = pkgs.writeShellScriptBin "goimports" ''
export GOTOOLCHAIN=local
exec ${pkgs.gotools}/bin/goimports "$@"
'';
};
gofmt = {
enable = true;
package = pkgs.writeShellScriptBin "gofmt" ''
export GOTOOLCHAIN=local
exec ${pkgs.go}/bin/gofmt "$@"
'';
};
};
}