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";
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
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 = {
|
disko = {
|
||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
|
@ -58,7 +64,6 @@
|
||||||
./shell.nix
|
./shell.nix
|
||||||
./utils
|
./utils
|
||||||
./machines
|
./machines
|
||||||
] // (flake-utils.lib.eachDefaultSystem (system: {
|
./formatter.nix
|
||||||
formatter = nixpkgs.legacyPackages.${system}.nixfmt;
|
];
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
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