-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
nginx NixOS module: generated configuration has many superfluous newlines #34377
Comments
I had a nginx configuration file cleaner submitted a while back, but it got backed out for not working quite right. (Around Unicode, iirc.) Perhaps it's time to take another look at that. |
Nginx is particularly bad because the expression is quite complicated but this applies to practically every configuration files NixOS generates. Here's some xorg.conf
torrc.conf
homeserver.yaml
Personally I don't care much about the generated files: I'm not going to read it after I tested the module but It would be a nice improvement. If you try to generate clean files the code usually turns into a mess. A possible solution could be to remove empty lines. Not sure about the broken indentation. |
Workaround: view the file through |
Allternatively we could use https://github.com/vasilevich/nginxbeautifier if needing minimal nodejs at build-time isn't a problem. EDIT: Also found https://github.com/1connect/nginx-config-formatter, which is written in python. |
Is formatted now. |
Issue description
A generated nginx configuration file contains many newlines, which make the file much longer than needed (and it makes it harder to read).
Steps to reproduce
service.nginx.enable = true;
Technical details
"x86_64-linux"
Linux 4.13.4, NixOS, 17.09.git.39cd40f (Hummingbird)
yes
no
nix-env (Nix) 1.11.15
"nixos-17.09.2182.7f6f0c49f0"
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
The text was updated successfully, but these errors were encountered: