Nixpkgs/Create and debug packages: Difference between revisions

imported>Jmarmstrong1207
Change method to run specific phase. runPhase was added and easier to use
0x4A6F (talk | contribs)
Use official formatter
Line 442: Line 442:
</syntaxhighlight>
</syntaxhighlight>


== Formatting Packages with nixpkgs-fmt ==
== Formatting Packages with nixfmt ==
It is "good practice" to format packages in a way that following changed will create as minimal diffs as possible. The formatter [https://github.com/nix-community/nixpkgs-fmt nixpkgs-fmt] can be used for that.
It is "good practice" to format packages in a way that following changed will create as minimal diffs as possible. The formatter [https://github.com/NixOS/nixfmt nixfmt] can be used for that.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
nixpkgs-fmt path/to/default.nix
nix-shell -p nixfmt-rfc-style --run 'nixfmt path/to/default.nix'
</syntaxhighlight>
</syntaxhighlight>