diff --git a/.helix/languages.toml b/.helix/languages.toml new file mode 100644 index 0000000..93560f9 --- /dev/null +++ b/.helix/languages.toml @@ -0,0 +1,5 @@ +[[language]] +name = "go" +auto-format = true +formatter = { command = "gofumpt" } + diff --git a/flake.lock b/flake.lock index ef63308..67407b9 100644 --- a/flake.lock +++ b/flake.lock @@ -13,20 +13,25 @@ "type": "github" }, "original": { - "id": "flake-utils", - "type": "indirect" + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 0, - "narHash": "sha256-WFZDy4bG2RkkCQloIEG8BXEvzyKklFVJbAismOJsIp4=", - "path": "/nix/store/c77dsgfxjywplw8bk8s8jlkdsr7a1bi9-source", - "type": "path" + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { diff --git a/flake.nix b/flake.nix index 36a545e..f540f73 100644 --- a/flake.nix +++ b/flake.nix @@ -1,27 +1,53 @@ { - outputs = { - self, - nixpkgs, - flake-utils, - systems, - }: - flake-utils.lib.eachSystem (import systems) - (system: let - pkgs = import nixpkgs { - inherit system; - }; - in { - devShells.default = pkgs.mkShell { - buildInputs = with pkgs; [ - glibc.static - go - gofumpt - golangci-lint - gopls - gotools - go-tools - sqlite-interactive - ]; - }; - }); + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + systems, + }: + flake-utils.lib.eachSystem (import systems) ( + system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + { + devShells = { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + glibc.static + go + gofumpt + golangci-lint + gopls + gotools + go-tools + sqlite-interactive + ]; + }; + + helix = pkgs.mkShell { + packages = with pkgs; [ + marksman # markdown + nodePackages.prettier # formatting for markdown and yaml + taplo # toml + bash-language-server + shellcheck # dependency for bash-ls + shfmt # dependency for bash-ls + yaml-language-server + treefmt # formatter multiplexer + nil # nix ls + nixfmt-rfc-style # formatter for nix + ]; + }; + }; + } + ); } diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..8446a25 --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,14 @@ +formatters = ["gofumpt", "prettier", "nixfmt"] + +[formatter.gofumpt] +command = "gofumpt" +includes = [ "*.go" ] + +[formatter.prettier] +command = "prettier" +includes = [ "*.md", "*.yaml" ] + +[formatter.nixfmt] +command = "nixfmt" +includes = [ "*.nix" ] +