-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add NixOS modules options that using verbatim nginx config #31
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,3 +121,53 @@ | |
| (#set! injection.language "css") | ||
| (#set! injection.combined) | ||
| ) | ||
|
|
||
| ; Nginx | ||
| ; https://search.nixos.org/options?query=services.nginx.%20config | ||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" "nginx" "((events|stream|(prep|app)end)C|c)onfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" "nginx" "((append|common)H|h)ttpConfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
|
|
||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" "nginx" "upstreams" ".*" "extraConfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
|
|
||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" "nginx" "virtualHosts" ".*" "extraConfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" "nginx" "virtualHosts" ".*" "locations" ".*" "extraConfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
|
Comment on lines
+140
to
+158
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These three
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ; https://search.nixos.org/options?query=services.%20nginx.%20config | ||
| ; https://github.com/search?q=repo%3ANixOS%2Fnixpkgs%20nginx%2Fvhost-options.nix&type=code | ||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" ".*" "nginx" "extraConfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
| (binding | ||
| attrpath: (_) @_path (#hmts-path? @_path "services" ".*" "nginx" "locations" ".*" "extraConfig") | ||
| expression: (_ (string_fragment) @injection.content) | ||
| (#set! injection.language "nginx") | ||
| (#set! injection.combined) | ||
| ) | ||
|
Comment on lines
+162
to
+173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous comments, these two |
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two
bindingblocks are very similar and can be combined into one for better conciseness and maintainability. You can merge the two regular expressions for the attribute path using an|operator.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're unrelated as
*configlays under the top-levelmaincontext like many directives in thecoremodule, and*HttpConfigis under thehttpcontext: https://nginx.org/en/docs/beginners_guide.html#Configuration%20File%E2%80%99s%20Structure:~:text=Configuration%20File%E2%80%99s%20Structure,-nginx