flake: add treefmt

This commit is contained in:
Leonardo Eugênio 2025-01-24 08:24:42 -03:00
parent 7fe58549d7
commit 22d0342233
3 changed files with 50 additions and 4 deletions

View file

@ -626,6 +626,22 @@
} }
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": {
"lastModified": 1735554305,
"narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1719010183, "lastModified": 1719010183,
"narHash": "sha256-8HMWaqpyjbVeEsmy/A2H6VFtW/Wr71vkPLnpTiAXu+8=", "narHash": "sha256-8HMWaqpyjbVeEsmy/A2H6VFtW/Wr71vkPLnpTiAXu+8=",
@ -641,7 +657,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_7": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1714091391, "lastModified": 1714091391,
"narHash": "sha256-68n3GBvlm1MIeJXadPzQ3v8Y9sIW3zmv8gI5w5sliC8=", "narHash": "sha256-68n3GBvlm1MIeJXadPzQ3v8Y9sIW3zmv8gI5w5sliC8=",
@ -708,6 +724,7 @@
"ranger-icons": "ranger-icons", "ranger-icons": "ranger-icons",
"tlauncher": "tlauncher", "tlauncher": "tlauncher",
"tomater": "tomater", "tomater": "tomater",
"treefmt-nix": "treefmt-nix",
"vpsadminos": "vpsadminos", "vpsadminos": "vpsadminos",
"warthunder-leak-counter": "warthunder-leak-counter", "warthunder-leak-counter": "warthunder-leak-counter",
"wl-crosshair": "wl-crosshair", "wl-crosshair": "wl-crosshair",
@ -900,6 +917,24 @@
"url": "https://git.lelgenio.com/lelgenio/tomater" "url": "https://git.lelgenio.com/lelgenio/tomater"
} }
}, },
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1737483750,
"narHash": "sha256-5An1wq5U8sNycOBBg3nsDDgpwBmR9liOpDGlhliA6Xo=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "f2cc121df15418d028a59c9737d38e3a90fbaf8f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"vpsadminos": { "vpsadminos": {
"locked": { "locked": {
"lastModified": 1737136524, "lastModified": 1737136524,
@ -919,7 +954,7 @@
"inputs": { "inputs": {
"crane": "crane_3", "crane": "crane_3",
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1719076817, "lastModified": 1719076817,
@ -938,7 +973,7 @@
"wl-crosshair": { "wl-crosshair": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_7", "flake-utils": "flake-utils_7",
"nixpkgs": "nixpkgs_7" "nixpkgs": "nixpkgs_8"
}, },
"locked": { "locked": {
"lastModified": 1715216838, "lastModified": 1715216838,

View file

@ -43,6 +43,8 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
treefmt-nix.url = "github:numtide/treefmt-nix";
# my stuff # my stuff
dhist.url = "github:lelgenio/dhist"; dhist.url = "github:lelgenio/dhist";
demoji.url = "github:lelgenio/demoji"; demoji.url = "github:lelgenio/demoji";
@ -176,6 +178,7 @@
packages.${system} = pkgs // packages; packages.${system} = pkgs // packages;
formatter.${system} = pkgs.nixfmt-rfc-style; # formatter.${system} = pkgs.nixfmt-rfc-style;
formatter.${system} = (inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix).config.build.wrapper;
}; };
} }

8
treefmt.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.nixfmt.package = pkgs.nixfmt-rfc-style;
settings.on-unmatched = "debug";
}