Files
Juan Giordana 3c53bfc0e6 feat(nixfmt-tree): Update default formatters to pkgs.nixfmt-tree
`pkgs.nixfmt-tree` is being recommended as the official Nix formatter:
<https://nix.dev/manual/nix/2.35/command-ref/new-cli/nix3-fmt#example>

Update default formatters to `pkgs.nixfmt-tree` to avoid the following
deprecation warnings when using `nix fmt`, `nix fmt .` or `nix fmt -- .`:

- Warning: Bare invocation of nixfmt is deprecated. Use `nixfmt -` for
  anonymous `stdin`.
- Passing directories or non-Nix files (such as ".") is deprecated and will be
  unsupported soon. Please use the `pkgs.nixfmt-tree` wrapper instead, or
  <https://github.com/numtide/treefmt-nix> for more flexibility.
2026-10-14 16:23:42 -03:00

45 lines
993 B
Nix

{
description = "A Nix-flake-based Elm development environment";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs
outputs =
{ self, ... }@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs { inherit system; };
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs, system }:
{
default = pkgs.mkShellNoCC {
packages =
with pkgs;
[
elm2nix
self.formatter.${system}
]
++ (with elmPackages; [ elm ]);
};
}
);
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt-tree);
};
}