-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format using nixfmt-rfc-style #1526
Conversation
This was inspired by a real world use case: Building @faldor20 's https://github.com/faldor20/jj_tui Will fail to build on versions of Nix that have fully deprecated URL literals due to packages such as nix-overlays/ocaml/default.nix Line 160 in 0617ef8
An alternative fix could be to do a tree-wide replacement of URL literals with strings containing a URL. |
Thanks. before I take a closer look, could you point me to more information as to why URL literals were deprecated? |
This sounds like a good change. we run |
This PR effectively endorses moving from
nix-overlays-upstream on master
-> nixfmt --check .
./flake.nix: not formatted
./ci/hydra_jobs.nix: not formatted
./ci/filter.nix: not formatted
./ci/default.nix: not formatted
./ci/hydra.nix: not formatted
./cockroachdb/generic.nix: not formatted
./cockroachdb/default.nix: not formatted
./ocaml/janestreet-0.16.nix: not formatted
./ocaml/overlay-ocaml-packages.nix: not formatted
./ocaml/subscriptions-transport-ws/default.nix: not formatted
./ocaml/piaf/carl.nix: not formatted
./ocaml/piaf/default.nix: not formatted
./ocaml/redis/lwt.nix: not formatted
...
./static/default.nix: not formatted
nix-overlays-upstream on master
-> Part of this PR could be moving to a more canonical approach such as setting the |
this sounds good to me. would you do this in a separate PR so that I can better assess the diff? then we could rebase this one on top, which would just be changing the URL strings |
#1541 changed URLs to plain strings. Feel free to propose a separate PR changing the formatter. |
Since RFC 0166 is now merged,
pkgs.nixfmt-rfc-style
can format nix files to be conformant.This has some upsides such as:
The latter is relevant to some use cases.
For example, users on later versions of
nix
or those who set theno-url-literals
experimental feature cannot evaluate URL literals.If a package depends on the OCaml Nix Overlays with these features, it will error out and fail to build.
This merge would format the repository to the RFC 0166 standard using
pkgs.nixfmt-rfc-style
and adopt all the automatic fixes it brings along.