The motivation is similar to (and implementation taken partly from)
#271288 --- some rebar3-compiled `.beam` files contain debug information
exposing references to `.hrl` files from the Erlang distribution it
was compiled with. This results in unnecessary store references.
See also #423588's change to Elixir's `generic-builder.nix` where the
same option is used when building to avoid the same issue.
See previous discussion at https://github.com/NixOS/nixpkgs/pull/429770.
cc @adamcstephens.
This is equivalent to giving `appConfigPath` an empty directory, but
expresses intent better (and doesn't require throwing an empty directory
into the store).
The Elixir ecosystem assumes [1] that dependencies are compiled without
their config; the `config/` directory is therefore used in library-only
projects to supply config values only intended for use when _developing_
them. This leads to errors only seen in Nix when compile-time config
lacks runtime equivalents in end-user applications (per the whole
conversation at [1]).
Right now, the only way to get `buildMix` to build without config is to
manually remove the target's config directory in a hook/override, or (as
above) give `appConfigPath` an empty directory. This PR adds a clearer
mechanism, and makes it the default.
[1] https://github.com/dashbitco/lazy_html/pull/11#issuecomment-3138715485
Tested with a `mix2nix`-using package that this functions as expected,
and with some `deps_nix`-using ones that `appConfigPath` still does too.
Based on the Nixpkgs used and the version of nixfmt-rfc-style in that
version, it's likely that not the correct version is used.
Update scripts should instead run within a Nixpkgs development shell
(`nix-shell`/`nix develop`/`direnv`), where the correct version of
`nixfmt` (although `treefmt` should be preferred) is always available.
buildMix currently uses $src/* when copying source files into $out.
However, this does not include important hidden files like
`.formatter.exs` which contains custom package formatters, for example.
This reverts commit 65a333600d.
This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.
It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).
A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.
[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.