馃殌 Grammar-Aware Code Formatter: Structure through separation (supports Go, JavaScript, TypeScript, JSX, and TSX)
go
formatter
code-formatter
javascript
typescript
jsx
tsx
1{
2 description = "Grammar-Aware Go Formatter";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6 flake-utils.url = "github:numtide/flake-utils";
7 };
8
9 outputs =
10 {
11 self,
12 nixpkgs,
13 flake-utils,
14 ...
15 }:
16 flake-utils.lib.eachDefaultSystem (
17 system:
18 let
19 pkgs = import nixpkgs { inherit system; };
20 version = self.shortRev or "dirty";
21 in
22 {
23 packages.default = pkgs.buildGo125Module {
24 inherit version;
25
26 pname = "iku";
27 src = pkgs.lib.cleanSource ./.;
28 vendorHash = null;
29 ldflags = [
30 "-s"
31 "-w"
32 "-X main.version=${version}"
33 ];
34
35 meta = with pkgs.lib; {
36 description = "Grammar-Aware Go Formatter";
37 homepage = "https://github.com/Fuwn/iku";
38 license = [
39 licenses.mit
40 licenses.asl20
41 ];
42 platforms = platforms.unix;
43 };
44 };
45
46 devShells.default = pkgs.mkShell {
47 buildInputs = [ pkgs.go_1_25 ];
48 };
49 }
50 );
51}