0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

treewide: fix mkEnableOption usage

This commit is contained in:
éclairevoyant 2024-06-03 12:59:45 -04:00
parent f587de5d7f
commit 7d8742da87
No known key found for this signature in database
GPG key ID: E3813AEAA02DB54B
41 changed files with 66 additions and 67 deletions

View file

@ -96,12 +96,17 @@ in
{option}`documentation.man.mandoc.manPath` to an empty list (`[]`). {option}`documentation.man.mandoc.manPath` to an empty list (`[]`).
''; '';
}; };
output.fragment = lib.mkEnableOption '' output.fragment = lib.mkOption {
Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body> type = lib.types.bool;
elements and only emit the subtree below the <body> element in HTML default = false;
output of {manpage}`mandoc(1)`. The style argument will be ignored. example = true;
This is useful when embedding manual content within existing documents. description = ''
''; Whether to omit the <!DOCTYPE> declaration and the <html>, <head>, and <body>
elements and only emit the subtree below the <body> element in HTML
output of {manpage}`mandoc(1)`. The style argument will be ignored.
This is useful when embedding manual content within existing documents.
'';
};
output.includes = lib.mkOption { output.includes = lib.mkOption {
type = with lib.types; nullOr str; type = with lib.types; nullOr str;
default = null; default = null;
@ -160,9 +165,9 @@ in
''; '';
}; };
output.toc = lib.mkEnableOption '' output.toc = lib.mkEnableOption ''
In HTML output of {manpage}`mandoc(1)`, If an input file contains printing a table of contents near the beginning of the HTML output
at least two non-standard sections, print a table of contents near of {manpage}`mandoc(1)` if an input file contains at least two
the beginning of the output. non-standard sections
''; '';
output.width = lib.mkOption { output.width = lib.mkOption {
type = with lib.types; nullOr int; type = with lib.types; nullOr int;

View file

@ -8,9 +8,7 @@ in {
options = { options = {
programs.dublin-traceroute = { programs.dublin-traceroute = {
enable = lib.mkEnableOption '' enable = lib.mkEnableOption "dublin-traceroute (including setcap wrapper)";
dublin-traceroute, add it to the global environment and configure a setcap wrapper for it.
'';
package = lib.mkPackageOption pkgs "dublin-traceroute" { }; package = lib.mkPackageOption pkgs "dublin-traceroute" { };
}; };

View file

@ -1,7 +1,7 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
{ {
options.programs.joycond-cemuhook = { options.programs.joycond-cemuhook = {
enable = lib.mkEnableOption "joycond-cemuhook, a program to enable support for cemuhook's UDP protocol for joycond devices."; enable = lib.mkEnableOption "joycond-cemuhook, a program to enable support for cemuhook's UDP protocol for joycond devices";
}; };
config = lib.mkIf config.programs.joycond-cemuhook.enable { config = lib.mkIf config.programs.joycond-cemuhook.enable {

View file

@ -6,7 +6,7 @@ in
{ {
options.programs.mouse-actions = { options.programs.mouse-actions = {
enable = lib.mkEnableOption '' enable = lib.mkEnableOption ''
mouse-actions udev rules. This is a prerequisite for using mouse-actions without being root. mouse-actions udev rules. This is a prerequisite for using mouse-actions without being root
''; '';
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -26,13 +26,13 @@ in
security.pki.useCompatibleBundle = mkEnableOption ''usage of a compatibility bundle. security.pki.useCompatibleBundle = mkEnableOption ''usage of a compatibility bundle.
Such a bundle consist exclusively of `BEGIN CERTIFICATE` and no `BEGIN TRUSTED CERTIFICATE`, Such a bundle consists exclusively of `BEGIN CERTIFICATE` and no `BEGIN TRUSTED CERTIFICATE`,
which is a OpenSSL specific PEM format. which is an OpenSSL specific PEM format.
It is known to be incompatible with certain software stacks. It is known to be incompatible with certain software stacks.
Nevertheless, enabling this will strip all additional trust rules provided by the Nevertheless, enabling this will strip all additional trust rules provided by the
certificates themselves, this can have security consequences depending on your usecases. certificates themselves. This can have security consequences depending on your usecases
''; '';
security.pki.certificateFiles = mkOption { security.pki.certificateFiles = mkOption {

View file

@ -1055,7 +1055,7 @@ in
the dp9ik pam module provided by tlsclient. the dp9ik pam module provided by tlsclient.
If set, users can be authenticated against the 9front If set, users can be authenticated against the 9front
authentication server given in {option}`security.pam.dp9ik.authserver`. authentication server given in {option}`security.pam.dp9ik.authserver`
''; '';
control = mkOption { control = mkOption {
default = "sufficient"; default = "sufficient";

View file

@ -41,7 +41,7 @@ in
enable = mkEnableOption '' enable = mkEnableOption ''
a memory-safe implementation of the {command}`sudo` command, a memory-safe implementation of the {command}`sudo` command,
which allows non-root users to execute commands as root. which allows non-root users to execute commands as root
''; '';
package = mkPackageOption pkgs "sudo-rs" { }; package = mkPackageOption pkgs "sudo-rs" { };

View file

@ -37,7 +37,7 @@ in
description = "The port to bind to."; description = "The port to bind to.";
}; };
enableUnixSocket = mkEnableOption "Unix Domain Socket at /run/memcached/memcached.sock instead of listening on an IP address and port. The `listen` and `port` options are ignored."; enableUnixSocket = mkEnableOption "Unix Domain Socket at /run/memcached/memcached.sock instead of listening on an IP address and port. The `listen` and `port` options are ignored";
maxMemory = mkOption { maxMemory = mkOption {
type = types.ints.unsigned; type = types.ints.unsigned;

View file

@ -52,7 +52,7 @@ let
in in
{ {
options.services.mautrix-signal = { options.services.mautrix-signal = {
enable = lib.mkEnableOption "mautrix-signal, a Matrix-Signal puppeting bridge."; enable = lib.mkEnableOption "mautrix-signal, a Matrix-Signal puppeting bridge";
settings = lib.mkOption { settings = lib.mkOption {
apply = lib.recursiveUpdate defaultConfig; apply = lib.recursiveUpdate defaultConfig;

View file

@ -47,7 +47,7 @@
in { in {
options.services.mautrix-whatsapp = { options.services.mautrix-whatsapp = {
enable = lib.mkEnableOption "mautrix-whatsapp, a puppeting/relaybot bridge between Matrix and WhatsApp."; enable = lib.mkEnableOption "mautrix-whatsapp, a puppeting/relaybot bridge between Matrix and WhatsApp";
settings = lib.mkOption { settings = lib.mkOption {
type = settingsFormat.type; type = settingsFormat.type;

View file

@ -124,7 +124,7 @@ let
in { in {
options = { options = {
services.mqtt2influxdb = { services.mqtt2influxdb = {
enable = mkEnableOption "BigClown MQTT to InfluxDB bridge."; enable = mkEnableOption "BigClown MQTT to InfluxDB bridge";
package = mkPackageOption pkgs ["python3Packages" "mqtt2influxdb"] {}; package = mkPackageOption pkgs ["python3Packages" "mqtt2influxdb"] {};
environmentFiles = mkOption { environmentFiles = mkOption {
type = types.listOf types.path; type = types.listOf types.path;

View file

@ -225,7 +225,7 @@ in
effectively never complete due to running into timeouts. effectively never complete due to running into timeouts.
This sets `OMP_NUM_THREADS` to `1` in order to mitigate the issue. See This sets `OMP_NUM_THREADS` to `1` in order to mitigate the issue. See
https://github.com/NixOS/nixpkgs/issues/240591 for more information. https://github.com/NixOS/nixpkgs/issues/240591 for more information
'' // mkOption { default = true; }; '' // mkOption { default = true; };
}; };

View file

@ -70,7 +70,7 @@ in
To activate dex, first a search user must be created in the Portunus web ui To activate dex, first a search user must be created in the Portunus web ui
and then the password must to be set as the `DEX_SEARCH_USER_PASSWORD` environment variable and then the password must to be set as the `DEX_SEARCH_USER_PASSWORD` environment variable
in the [](#opt-services.dex.environmentFile) setting. in the [](#opt-services.dex.environmentFile) setting
''; '';
oidcClients = mkOption { oidcClients = mkOption {

View file

@ -6,7 +6,7 @@ in
{ {
options = { options = {
services.spice-autorandr = { services.spice-autorandr = {
enable = lib.mkEnableOption "spice-autorandr service that will automatically resize display to match SPICE client window size."; enable = lib.mkEnableOption "spice-autorandr service that will automatically resize display to match SPICE client window size";
package = lib.mkPackageOption pkgs "spice-autorandr" { }; package = lib.mkPackageOption pkgs "spice-autorandr" { };
}; };
}; };

View file

@ -4,7 +4,7 @@ let
UDPPorts = [21116]; UDPPorts = [21116];
in { in {
options.services.rustdesk-server = with lib; with types; { options.services.rustdesk-server = with lib; with types; {
enable = mkEnableOption "RustDesk, a remote access and remote control software, allowing maintenance of computers and other devices."; enable = mkEnableOption "RustDesk, a remote access and remote control software, allowing maintenance of computers and other devices";
package = mkPackageOption pkgs "rustdesk-server" {}; package = mkPackageOption pkgs "rustdesk-server" {};

View file

@ -696,7 +696,7 @@ in {
}; };
store = paramsToOptions params.store // { store = paramsToOptions params.store // {
enable = mkEnableOption "the Thanos store node giving access to blocks in a bucket provider."; enable = mkEnableOption "the Thanos store node giving access to blocks in a bucket provider";
arguments = mkArgumentsOption "store"; arguments = mkArgumentsOption "store";
}; };

View file

@ -385,8 +385,8 @@ in
power.ups = { power.ups = {
enable = mkEnableOption '' enable = mkEnableOption ''
Enables support for Power Devices, such as Uninterruptible Power support for Power Devices, such as Uninterruptible Power
Supplies, Power Distribution Units and Solar Controllers. Supplies, Power Distribution Units and Solar Controllers
''; '';
mode = mkOption { mode = mkOption {

View file

@ -183,7 +183,7 @@ in {
enableFabs = mkEnableOption '' enableFabs = mkEnableOption ''
FABS, the flexible AFS backup system. It stores volumes as dump files, relying on other FABS, the flexible AFS backup system. It stores volumes as dump files, relying on other
pre-existing backup solutions for handling them. pre-existing backup solutions for handling them
''; '';
buserverArgs = mkOption { buserverArgs = mkOption {

View file

@ -10,7 +10,7 @@ in {
services.samba-wsdd = { services.samba-wsdd = {
enable = mkEnableOption '' enable = mkEnableOption ''
Web Services Dynamic Discovery host daemon. This enables (Samba) hosts, like your local NAS device, Web Services Dynamic Discovery host daemon. This enables (Samba) hosts, like your local NAS device,
to be found by Web Service Discovery Clients like Windows. to be found by Web Service Discovery Clients like Windows
''; '';
interface = mkOption { interface = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;

View file

@ -87,17 +87,17 @@ in {
}; };
dynamips = { dynamips = {
enable = lib.mkEnableOption ''Whether to enable Dynamips support.''; enable = lib.mkEnableOption ''Dynamips support'';
package = lib.mkPackageOptionMD pkgs "dynamips" { }; package = lib.mkPackageOptionMD pkgs "dynamips" { };
}; };
ubridge = { ubridge = {
enable = lib.mkEnableOption ''Whether to enable uBridge support.''; enable = lib.mkEnableOption ''uBridge support'';
package = lib.mkPackageOptionMD pkgs "ubridge" { }; package = lib.mkPackageOptionMD pkgs "ubridge" { };
}; };
vpcs = { vpcs = {
enable = lib.mkEnableOption ''Whether to enable VPCS support.''; enable = lib.mkEnableOption ''VPCS support'';
package = lib.mkPackageOptionMD pkgs "vpcs" { }; package = lib.mkPackageOptionMD pkgs "vpcs" { };
}; };
}; };

View file

@ -17,7 +17,7 @@ with lib;
options = { options = {
services.haproxy = { services.haproxy = {
enable = mkEnableOption "HAProxy, the reliable, high performance TCP/HTTP load balancer."; enable = mkEnableOption "HAProxy, the reliable, high performance TCP/HTTP load balancer";
package = mkPackageOption pkgs "haproxy" { }; package = mkPackageOption pkgs "haproxy" { };

View file

@ -312,9 +312,9 @@ in
}; };
faxqclean.enable.spoolInit = mkEnableOption '' faxqclean.enable.spoolInit = mkEnableOption ''
Purge old files from the spooling area with purging old files from the spooling area with
{file}`faxqclean` {file}`faxqclean`
each time the spooling area is initialized. each time the spooling area is initialized
''; '';
faxqclean.enable.frequency = mkOption { faxqclean.enable.frequency = mkOption {
type = nullOr nonEmptyStr; type = nullOr nonEmptyStr;

View file

@ -39,7 +39,7 @@ in
package = mkPackageOption pkgs "netbird-dashboard" { }; package = mkPackageOption pkgs "netbird-dashboard" { };
enableNginx = mkEnableOption "Nginx reverse-proxy to serve the dashboard."; enableNginx = mkEnableOption "Nginx reverse-proxy to serve the dashboard";
domain = mkOption { domain = mkOption {
type = str; type = str;

View file

@ -137,7 +137,7 @@ in
{ {
options.services.netbird.server.management = { options.services.netbird.server.management = {
enable = mkEnableOption "Netbird Management Service."; enable = mkEnableOption "Netbird Management Service";
package = mkPackageOption pkgs "netbird" { }; package = mkPackageOption pkgs "netbird" { };
@ -335,7 +335,7 @@ in
description = "Log level of the netbird services."; description = "Log level of the netbird services.";
}; };
enableNginx = mkEnableOption "Nginx reverse-proxy for the netbird management service."; enableNginx = mkEnableOption "Nginx reverse-proxy for the netbird management service";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -31,7 +31,7 @@ in
options.services.netbird.server = { options.services.netbird.server = {
enable = mkEnableOption "Netbird Server stack, comprising the dashboard, management API and signal service"; enable = mkEnableOption "Netbird Server stack, comprising the dashboard, management API and signal service";
enableNginx = mkEnableOption "Nginx reverse-proxy for the netbird server services."; enableNginx = mkEnableOption "Nginx reverse-proxy for the netbird server services";
domain = mkOption { domain = mkOption {
type = str; type = str;

View file

@ -28,7 +28,7 @@ in
package = mkPackageOption pkgs "netbird" { }; package = mkPackageOption pkgs "netbird" { };
enableNginx = mkEnableOption "Nginx reverse-proxy for the netbird signal service."; enableNginx = mkEnableOption "Nginx reverse-proxy for the netbird signal service";
domain = mkOption { domain = mkOption {
type = str; type = str;

View file

@ -14,7 +14,7 @@ in {
enable = mkEnableOption '' enable = mkEnableOption ''
Networkd-dispatcher service for systemd-networkd connection status Networkd-dispatcher service for systemd-networkd connection status
change. See [https://gitlab.com/craftyguy/networkd-dispatcher](upstream instructions) change. See [https://gitlab.com/craftyguy/networkd-dispatcher](upstream instructions)
for usage. for usage
''; '';
rules = mkOption { rules = mkOption {

View file

@ -34,9 +34,7 @@ in {
[](#opt-programs.nncp.settings) [](#opt-programs.nncp.settings)
''; '';
socketActivation = { socketActivation = {
enable = mkEnableOption '' enable = mkEnableOption "socket activation for nncp-daemon";
Whether to run nncp-daemon persistently or socket-activated.
'';
listenStreams = mkOption { listenStreams = mkOption {
type = with types; listOf str; type = with types; listOf str;
description = '' description = ''

View file

@ -263,7 +263,7 @@ in
''; '';
type = with types; attrsOf (either lines (submodule ({ name, ... }: { type = with types; attrsOf (either lines (submodule ({ name, ... }: {
options = { options = {
enabled = mkEnableOption "this jail." // { enabled = mkEnableOption "this jail" // {
default = true; default = true;
readOnly = name == "DEFAULT"; readOnly = name == "DEFAULT";
}; };

View file

@ -17,7 +17,7 @@ in
enable = mkEnableOption '' enable = mkEnableOption ''
haveged entropy daemon, which refills /dev/random when low. haveged entropy daemon, which refills /dev/random when low.
NOTE: does nothing on kernels newer than 5.6. NOTE: does nothing on kernels newer than 5.6
''; '';
# source for the note https://github.com/jirka-h/haveged/issues/57 # source for the note https://github.com/jirka-h/haveged/issues/57

View file

@ -8,7 +8,7 @@ in
{ {
options = { options = {
services.audiobookshelf = { services.audiobookshelf = {
enable = mkEnableOption "Audiobookshelf, self-hosted audiobook and podcast server."; enable = mkEnableOption "Audiobookshelf, self-hosted audiobook and podcast server";
package = mkPackageOption pkgs "audiobookshelf" { }; package = mkPackageOption pkgs "audiobookshelf" { };

View file

@ -170,7 +170,7 @@ in
''; '';
}; };
caddy.enable = mkEnableOption "Whether to enable caddy reverse proxy to expose jitsi-meet"; caddy.enable = mkEnableOption "caddy reverse proxy to expose jitsi-meet";
prosody.enable = mkOption { prosody.enable = mkOption {
type = bool; type = bool;

View file

@ -474,7 +474,7 @@ in {
implementation into the virtual filesystem. implementation into the virtual filesystem.
Further details about this feature can be found in the Further details about this feature can be found in the
[upstream documentation](https://docs.nextcloud.com/server/22/admin_manual/configuration_files/primary_storage.html). [upstream documentation](https://docs.nextcloud.com/server/22/admin_manual/configuration_files/primary_storage.html)
''; '';
bucket = mkOption { bucket = mkOption {
type = types.str; type = types.str;
@ -576,7 +576,7 @@ in {
This is used by the theming app and for generating previews of certain images (e.g. SVG and HEIF). This is used by the theming app and for generating previews of certain images (e.g. SVG and HEIF).
You may want to disable it for increased security. In that case, previews will still be available You may want to disable it for increased security. In that case, previews will still be available
for some images (e.g. JPEG and PNG). for some images (e.g. JPEG and PNG).
See <https://github.com/nextcloud/server/issues/13099>. See <https://github.com/nextcloud/server/issues/13099>
'' // { '' // {
default = true; default = true;
}; };

View file

@ -63,7 +63,7 @@ in
}; };
options.services.pretix = { options.services.pretix = {
enable = mkEnableOption "Pretix, a ticket shop application for conferences, festivals, concerts, etc."; enable = mkEnableOption "Pretix, a ticket shop application for conferences, festivals, concerts, etc";
package = mkPackageOption pkgs "pretix" { }; package = mkPackageOption pkgs "pretix" { };

View file

@ -12,7 +12,7 @@ in
{ {
options = { options = {
services.silverbullet = { services.silverbullet = {
enable = lib.mkEnableOption "Silverbullet, an open-source, self-hosted, offline-capable Personal Knowledge Management (PKM) web application."; enable = lib.mkEnableOption "Silverbullet, an open-source, self-hosted, offline-capable Personal Knowledge Management (PKM) web application";
package = lib.mkPackageOptionMD pkgs "silverbullet" { }; package = lib.mkPackageOptionMD pkgs "silverbullet" { };

View file

@ -9,7 +9,7 @@ in
{ {
options = { options = {
services.suwayomi-server = { services.suwayomi-server = {
enable = mkEnableOption "Suwayomi, a free and open source manga reader server that runs extensions built for Tachiyomi."; enable = mkEnableOption "Suwayomi, a free and open source manga reader server that runs extensions built for Tachiyomi";
package = lib.mkPackageOptionMD pkgs "suwayomi-server" { }; package = lib.mkPackageOptionMD pkgs "suwayomi-server" { };
@ -72,7 +72,7 @@ in
}; };
basicAuthEnabled = mkEnableOption '' basicAuthEnabled = mkEnableOption ''
Add basic access authentication to Suwayomi-Server. basic access authentication for Suwayomi-Server.
Enabling this option is useful when hosting on a public network/the Internet Enabling this option is useful when hosting on a public network/the Internet
''; '';

View file

@ -1086,9 +1086,9 @@ in
''; '';
description = "Declarative vhost config"; description = "Declarative vhost config";
}; };
validateConfigFile = lib.mkEnableOption '' validateConfigFile = lib.mkEnableOption "validating configuration with pkgs.writeNginxConfig" // {
Validate configuration with pkgs.writeNginxConfig. default = true;
'' // { default = true; }; };
}; };
}; };

View file

@ -57,12 +57,12 @@ in
options.testing = { options.testing = {
initrdBackdoor = lib.mkEnableOption '' initrdBackdoor = lib.mkEnableOption ''
enable backdoor.service in initrd. Requires backdoor.service in initrd. Requires
boot.initrd.systemd.enable to be enabled. Boot will pause in boot.initrd.systemd.enable to be enabled. Boot will pause in
stage 1 at initrd.target, and will listen for commands from the stage 1 at initrd.target, and will listen for commands from the
Machine python interface, just like stage 2 normally does. This Machine python interface, just like stage 2 normally does. This
enables commands to be sent to test and debug stage 1. Use enables commands to be sent to test and debug stage 1. Use
machine.switch_root() to leave stage 1 and proceed to stage 2. machine.switch_root() to leave stage 1 and proceed to stage 2
''; '';
}; };

View file

@ -149,7 +149,7 @@ in
Users in the "incus-admin" group can interact with Users in the "incus-admin" group can interact with
the daemon (e.g. to start or stop containers) using the the daemon (e.g. to start or stop containers) using the
{command}`incus` command line tool, among others. {command}`incus` command line tool, among others
''; '';
package = lib.mkPackageOption pkgs "incus-lts" { }; package = lib.mkPackageOption pkgs "incus-lts" { };

View file

@ -10,9 +10,7 @@ in
{ {
options = { options = {
virtualisation.multipass = { virtualisation.multipass = {
enable = lib.mkEnableOption '' enable = lib.mkEnableOption "Multipass, a simple manager for virtualised Ubuntu instances";
Multipass, a simple manager for virtualised Ubuntu instances.
'';
logLevel = lib.mkOption { logLevel = lib.mkOption {
type = lib.types.enum [ "error" "warning" "info" "debug" "trace" ]; type = lib.types.enum [ "error" "warning" "info" "debug" "trace" ];

View file

@ -900,7 +900,7 @@ in
}; };
virtualisation.tpm = { virtualisation.tpm = {
enable = mkEnableOption "a TPM device in the virtual machine with a driver, using swtpm."; enable = mkEnableOption "a TPM device in the virtual machine with a driver, using swtpm";
package = mkPackageOption cfg.host.pkgs "swtpm" { }; package = mkPackageOption cfg.host.pkgs "swtpm" { };