shell: Introduce treefmt

Introduces treefmt with a simple nixfmt-rfc-style configuration to
format all Nix files.

This is only practically usable with the following commit that formats
all files accordingly.
This commit is contained in:
Silvan Mosberger 2025-02-12 19:58:29 +01:00 committed by Silvan Mosberger
parent 02b2743b6a
commit 398e74f70b
2 changed files with 38 additions and 5 deletions

View file

@ -16,7 +16,7 @@
nixpkgs ? null,
}:
let
inherit (import ./ci { inherit nixpkgs system; }) pkgs;
inherit (import ./ci { inherit nixpkgs system; }) pkgs fmt;
# For `nix-shell -A hello`
curPkgs = builtins.removeAttrs (import ./. { inherit system; }) [
@ -28,10 +28,10 @@ let
in
curPkgs
// pkgs.mkShellNoCC {
inputsFrom = [
fmt.shell
];
packages = with pkgs; [
# The default formatter for Nix code
# See https://github.com/NixOS/nixfmt
nixfmt-rfc-style
# Helper to review Nixpkgs PRs
# See CONTRIBUTING.md
nixpkgs-review