Use treefmt-nix and Alejandro
This commit is contained in:
parent
2352a1a917
commit
eed797fb13
3 changed files with 21 additions and 3 deletions
11
flake.nix
11
flake.nix
|
@ -17,6 +17,12 @@
|
|||
deploy-rs.url = "github:serokell/deploy-rs";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/git-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
|
@ -58,7 +64,6 @@
|
|||
./shell.nix
|
||||
./utils
|
||||
./machines
|
||||
] // (flake-utils.lib.eachDefaultSystem (system: {
|
||||
formatter = nixpkgs.legacyPackages.${system}.nixfmt;
|
||||
}));
|
||||
./formatter.nix
|
||||
];
|
||||
}
|
||||
|
|
9
formatter.nix
Normal file
9
formatter.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ nixpkgs, treefmt-nix, flake-utils, ...}: flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
||||
in
|
||||
{
|
||||
formatter = treefmtEval.config.build.wrapper;
|
||||
}
|
||||
)
|
4
treefmt.nix
Normal file
4
treefmt.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{...}: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.alejandra.enable = true;
|
||||
}
|
Loading…
Reference in a new issue