Add formatter

This commit is contained in:
SebastianStork 2025-10-19 23:20:56 +02:00
parent 83176c294a
commit 453ab36d01
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
2 changed files with 37 additions and 2 deletions

23
flake.lock generated
View file

@ -35,7 +35,28 @@
"root": { "root": {
"inputs": { "inputs": {
"linkita": "linkita", "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"
} }
} }
}, },

View file

@ -2,6 +2,11 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
linkita = { linkita = {
url = "git+https://codeberg.org/salif/linkita.git"; url = "git+https://codeberg.org/salif/linkita.git";
flake = false; flake = false;
@ -11,6 +16,7 @@
outputs = outputs =
{ {
nixpkgs, nixpkgs,
treefmt,
linkita, 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;
}; };
} }