An Elixir toolkit for the AT Protocol. hexdocs.pm/atex
elixir bluesky atproto decentralization

chore: add treefmt

ovyerus.com 7d45f605 74d05f25

verified
+57 -2
+36 -1
flake.lock
··· 16 16 "type": "github" 17 17 } 18 18 }, 19 + "nixpkgs_2": { 20 + "locked": { 21 + "lastModified": 1770107345, 22 + "narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=", 23 + "owner": "nixos", 24 + "repo": "nixpkgs", 25 + "rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4", 26 + "type": "github" 27 + }, 28 + "original": { 29 + "owner": "nixos", 30 + "ref": "nixpkgs-unstable", 31 + "repo": "nixpkgs", 32 + "type": "github" 33 + } 34 + }, 19 35 "root": { 20 36 "inputs": { 21 - "nixpkgs": "nixpkgs" 37 + "nixpkgs": "nixpkgs", 38 + "treefmt-nix": "treefmt-nix" 39 + } 40 + }, 41 + "treefmt-nix": { 42 + "inputs": { 43 + "nixpkgs": "nixpkgs_2" 44 + }, 45 + "locked": { 46 + "lastModified": 1773297127, 47 + "narHash": "sha256-6E/yhXP7Oy/NbXtf1ktzmU8SdVqJQ09HC/48ebEGBpk=", 48 + "owner": "numtide", 49 + "repo": "treefmt-nix", 50 + "rev": "71b125cd05fbfd78cab3e070b73544abe24c5016", 51 + "type": "github" 52 + }, 53 + "original": { 54 + "owner": "numtide", 55 + "repo": "treefmt-nix", 56 + "type": "github" 22 57 } 23 58 } 24 59 },
+13 -1
flake.nix
··· 1 1 { 2 2 inputs = { 3 3 nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; 4 + treefmt-nix.url = "github:numtide/treefmt-nix"; 4 5 }; 5 6 6 - outputs = {nixpkgs, ...}: let 7 + outputs = { 8 + self, 9 + nixpkgs, 10 + treefmt-nix, 11 + ... 12 + }: let 7 13 forSystems = fn: 8 14 nixpkgs.lib.genAttrs [ 9 15 "aarch64-linux" ··· 12 18 "x86_64-linux" 13 19 ] (system: fn nixpkgs.legacyPackages.${system}); 14 20 defaultForSystems = fn: forSystems (pkgs: {default = fn pkgs;}); 21 + treefmtEval = forSystems (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix); 15 22 in { 16 23 devShells = defaultForSystems (pkgs: 17 24 pkgs.mkShell { 18 25 nativeBuildInputs = with pkgs; [elixir erlang]; 19 26 }); 27 + 28 + formatter = forSystems (pkgs: treefmtEval.${pkgs.stdenv.hostPlatform.system}.config.build.wrapper); 29 + checks = forSystems (pkgs: { 30 + formatting = treefmtEval.${pkgs.stdenv.hostPlatform.system}.config.build.check self; 31 + }); 20 32 }; 21 33 }
+8
treefmt.nix
··· 1 + {...}: { 2 + projectRootFile = "flake.nix"; 3 + programs.alejandra.enable = true; 4 + programs.mix-format.enable = true; 5 + programs.prettier.enable = true; 6 + 7 + settings.formatter.prettier.proseWrap = "always"; 8 + }