mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01: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
|
in
|
||||||
nixosTests // { inherit shellcheck; });
|
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…
Add table
Add a link
Reference in a new issue