nix-mode icon indicating copy to clipboard operation
nix-mode copied to clipboard

nixpkgs-fmt as nix-indent-function

Open alexarice opened this issue 6 years ago • 2 comments

Are there any plans to make an indent function based on nixpkgs-fmt or at least one that agrees with nixpkgs-fmt?

alexarice avatar Aug 30 '19 13:08 alexarice

You can easily just do what I do:

(customize-set-variable 'nix-nixfmt-bin "nixpkgs-fmt")

johnae avatar Feb 12 '20 15:02 johnae

AFAICT, the only indentation-related change needed is to align expressions with in. I did this by adding the following to nix-mode-hook:

(smie-config-local '((0 :after "in" nil)))

Do we want to standardize on the nixpkgs-fmt style and use this as the default in nix-smie-rules? It would be a quick PR.

tadfisher avatar Dec 08 '21 21:12 tadfisher