mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-18 23:50:07 +03:00

Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase
).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
162 lines
4.2 KiB
Nix
162 lines
4.2 KiB
Nix
# This file defines the options that can be used both for the Nginx
|
|
# main server configuration, and for the virtual hosts. (The latter
|
|
# has additional options that affect the web server as a whole, like
|
|
# the user/group to run under.)
|
|
|
|
{ lib, config }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
options = {
|
|
basicAuth = mkOption {
|
|
type = types.attrsOf types.str;
|
|
default = { };
|
|
example = literalExpression ''
|
|
{
|
|
user = "password";
|
|
};
|
|
'';
|
|
description = ''
|
|
Basic Auth protection for a vhost.
|
|
|
|
WARNING: This is implemented to store the password in plain text in the
|
|
Nix store.
|
|
'';
|
|
};
|
|
|
|
basicAuthFile = mkOption {
|
|
type = types.nullOr types.path;
|
|
default = null;
|
|
description = ''
|
|
Basic Auth password file for a vhost.
|
|
Can be created by running {command}`nix-shell --packages apacheHttpd --run 'htpasswd -B -c FILENAME USERNAME'`.
|
|
'';
|
|
};
|
|
|
|
proxyPass = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
example = "http://www.example.org/";
|
|
description = ''
|
|
Adds proxy_pass directive and sets recommended proxy headers if
|
|
recommendedProxySettings is enabled.
|
|
'';
|
|
};
|
|
|
|
proxyWebsockets = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
example = true;
|
|
description = ''
|
|
Whether to support proxying websocket connections with HTTP/1.1.
|
|
'';
|
|
};
|
|
|
|
uwsgiPass = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
example = "unix:/run/example/example.sock";
|
|
description = ''
|
|
Adds uwsgi_pass directive and sets recommended proxy headers if
|
|
recommendedUwsgiSettings is enabled.
|
|
'';
|
|
};
|
|
|
|
index = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
example = "index.php index.html";
|
|
description = ''
|
|
Adds index directive.
|
|
'';
|
|
};
|
|
|
|
tryFiles = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
example = "$uri =404";
|
|
description = ''
|
|
Adds try_files directive.
|
|
'';
|
|
};
|
|
|
|
root = mkOption {
|
|
type = types.nullOr types.path;
|
|
default = null;
|
|
example = "/your/root/directory";
|
|
description = ''
|
|
Root directory for requests.
|
|
'';
|
|
};
|
|
|
|
alias = mkOption {
|
|
type = types.nullOr types.path;
|
|
default = null;
|
|
example = "/your/alias/directory";
|
|
description = ''
|
|
Alias directory for requests.
|
|
'';
|
|
};
|
|
|
|
return = mkOption {
|
|
type =
|
|
with types;
|
|
nullOr (oneOf [
|
|
str
|
|
int
|
|
]);
|
|
default = null;
|
|
example = "301 http://example.com$request_uri";
|
|
description = ''
|
|
Adds a return directive, for e.g. redirections.
|
|
'';
|
|
};
|
|
|
|
fastcgiParams = mkOption {
|
|
type = types.attrsOf (types.either types.str types.path);
|
|
default = { };
|
|
description = ''
|
|
FastCGI parameters to override. Unlike in the Nginx
|
|
configuration file, overriding only some default parameters
|
|
won't unset the default values for other parameters.
|
|
'';
|
|
};
|
|
|
|
extraConfig = mkOption {
|
|
type = types.lines;
|
|
default = "";
|
|
description = ''
|
|
These lines go to the end of the location verbatim.
|
|
'';
|
|
};
|
|
|
|
priority = mkOption {
|
|
type = types.int;
|
|
default = 1000;
|
|
description = ''
|
|
Order of this location block in relation to the others in the vhost.
|
|
The semantics are the same as with `lib.mkOrder`. Smaller values have
|
|
a greater priority.
|
|
'';
|
|
};
|
|
|
|
recommendedProxySettings = mkOption {
|
|
type = types.bool;
|
|
default = config.services.nginx.recommendedProxySettings;
|
|
defaultText = literalExpression "config.services.nginx.recommendedProxySettings";
|
|
description = ''
|
|
Enable recommended proxy settings.
|
|
'';
|
|
};
|
|
|
|
recommendedUwsgiSettings = mkOption {
|
|
type = types.bool;
|
|
default = config.services.nginx.recommendedUwsgiSettings;
|
|
defaultText = literalExpression "config.services.nginx.recommendedUwsgiSettings";
|
|
description = ''
|
|
Enable recommended uwsgi settings.
|
|
'';
|
|
};
|
|
};
|
|
}
|