mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
style: Define formatter in flake to allow nix fmt
Noticed this was an option to codify the agreed style/pattern auto-normalise discussed in [#143] [#143]: https://github.com/nix-community/disko/pull/143
This commit is contained in:
parent
4ba8181319
commit
a393654c3b
1 changed files with 17 additions and 0 deletions
17
flake.nix
17
flake.nix
|
@ -57,5 +57,22 @@
|
|||
'';
|
||||
in
|
||||
nixosTests // { inherit shellcheck; });
|
||||
formatter = forAllSystems (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
pkgs.writeShellApplication {
|
||||
name = "normalise_nix";
|
||||
runtimeInputs = with pkgs; [
|
||||
nixpkgs-fmt
|
||||
statix
|
||||
];
|
||||
text = ''
|
||||
set -o xtrace
|
||||
nixpkgs-fmt "$@"
|
||||
statix fix "$@"
|
||||
'';
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue