diff --git a/flake.lock b/flake.lock index f953ce2..747b5d8 100644 --- a/flake.lock +++ b/flake.lock @@ -35,7 +35,28 @@ "root": { "inputs": { "linkita": "linkita", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "treefmt": "treefmt" + } + }, + "treefmt": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760889407, + "narHash": "sha256-ppIp04fmz+BaTpJs1nIOmPADg02asfQFrFbhb3SmxsE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "3f258dead9fed51f53862366d3a6bc1b622ee7cb", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 7d49c0a..c653e73 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,11 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + treefmt = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + linkita = { url = "git+https://codeberg.org/salif/linkita.git"; flake = false; @@ -11,6 +16,7 @@ outputs = { nixpkgs, + treefmt, linkita, ... }: @@ -28,6 +34,14 @@ ''; }; - formatter.${system} = pkgs.nixfmt-tree; + formatter.${system} = + (treefmt.lib.evalModule pkgs { + projectRootFile = "flake.nix"; + programs = { + nixfmt.enable = true; + prettier.enable = true; + just.enable = true; + }; + }).config.build.wrapper; }; }