Files
nix/tests/functional
Jeremy Fleischman ba6b617e75 Add nix formatter build command
`nix formatter build` is sort of like `nix build`: it builds, links, and
prints a path to the formatter program:

    $ nix formatter build
    /nix/store/cb9w44vkhk2x4adfxwgdkkf5gjmm856j-treefmt/bin/treefmt

Note that unlike `nix build`, this prints the full path to the program,
not just the store path (in the example above that would be
`/nix/store/cb9w44vkhk2x4adfxwgdkkf5gjmm856j-treefmt`).

Motivation
----------

I maintain a vim plugin that automatically runs `nix fmt` on files on
save. Since `nix fmt` can be quite slow due to nix evaluation, I choose
to cache the `nix fmt `entrypoint. This was very awkward to do, see the
implementation for details:
7864607231/lua/null-ls/builtins/formatting/nix_flake_fmt.lua (L83-L110).

I recently discovered that my implementation was buggy (it didn't handle
flakes that expose a `formatter` package, such as nixpkgs), so I had to
rework the implementation:
https://github.com/nvimtools/none-ls.nvim/pull/272.

With the new `nix formatter build` command, I can delete all this akward
code, and it will be easier for other folks to build performant editor
integrations for `nix fmt`.
2025-04-29 18:40:02 -07:00
..
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2024-08-14 15:35:40 -04:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-02-19 12:47:28 +01:00
2024-08-14 15:35:40 -04:00
2025-01-24 17:04:02 +01:00
2023-10-06 09:05:56 -04:00
2024-12-31 16:36:49 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2024-10-16 17:18:07 +02:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-04-29 18:40:02 -07:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-02-07 11:20:18 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-02-18 15:55:19 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 15:25:10 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2024-08-14 15:16:06 +02:00
2025-02-11 20:58:48 +01:00
2024-08-14 15:16:06 +02:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2024-08-14 15:16:06 +02:00
2024-08-14 15:16:06 +02:00
2025-02-12 22:05:38 +01:00
2024-08-14 15:16:06 +02:00
2024-08-14 15:16:06 +02:00
2024-06-11 16:05:57 +02:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00