Nixpkgs/Create and debug packages: Difference between revisions
imported>Jmarmstrong1207 Change method to run specific phase. runPhase was added and easier to use |
Use official formatter |
||
Line 442: | Line 442: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Formatting Packages with | == 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/ | 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"> | ||
nix-shell -p nixfmt-rfc-style --run 'nixfmt path/to/default.nix' | |||
</syntaxhighlight> | </syntaxhighlight> | ||