treewide: use mkEnableOption in nixos modules

This commit is contained in:
Daniel Nagy 2022-11-09 22:45:00 +01:00
parent 095269c862
commit b4674b39c1
No known key found for this signature in database
GPG key ID: 1B8E8DCB576FB671
31 changed files with 36 additions and 131 deletions

View file

@ -8,13 +8,12 @@ in
options = {
hardware.brillo = {
enable = mkEnableOption (lib.mdDoc ''
Enable brillo in userspace.
This will allow brightness control from users in the video group.
brillo in userspace.
This will allow brightness control from users in the video group
'');
};
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.brillo ];
environment.systemPackages = [ pkgs.brillo ];

View file

@ -10,7 +10,7 @@ let
};
in {
options.hardware.ubertooth = {
enable = mkEnableOption (lib.mdDoc "Enable the Ubertooth software and its udev rules.");
enable = mkEnableOption (lib.mdDoc "Ubertooth software and its udev rules");
group = mkOption {
type = types.str;

View file

@ -3,7 +3,7 @@
with lib;
{
options.hardware.wooting.enable =
mkEnableOption (lib.mdDoc "Enable support for Wooting keyboards");
mkEnableOption (lib.mdDoc "support for Wooting keyboards");
config = mkIf config.hardware.wooting.enable {
environment.systemPackages = [ pkgs.wootility ];

View file

@ -4,7 +4,7 @@ let
cfg = config.programs.kclock;
kclockPkg = pkgs.libsForQt5.kclock;
in {
options.programs.kclock = { enable = mkEnableOption (lib.mdDoc "Enable KClock"); };
options.programs.kclock = { enable = mkEnableOption (lib.mdDoc "KClock"); };
config = mkIf cfg.enable {
services.dbus.packages = [ kclockPkg ];

View file

@ -12,7 +12,7 @@ in
{
###### interface
options.services.kubernetes.flannel = {
enable = mkEnableOption (lib.mdDoc "enable flannel networking");
enable = mkEnableOption (lib.mdDoc "flannel networking");
};
###### implementation

View file

@ -18,7 +18,7 @@ in
'')
];
options.services.foldingathome = {
enable = mkEnableOption (lib.mdDoc "Enable the Folding@home client");
enable = mkEnableOption (lib.mdDoc "Folding@home client");
package = mkOption {
type = types.package;

View file

@ -34,13 +34,7 @@ in {
services.couchdb = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to run CouchDB Server.
'';
};
enable = mkEnableOption (lib.mdDoc "CouchDB Server");
package = mkOption {
type = types.package;

View file

@ -15,13 +15,7 @@ in {
services.opentsdb = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to run OpenTSDB.
'';
};
enable = mkEnableOption (lib.mdDoc "OpenTSDB");
package = mkOption {
type = types.package;

View file

@ -18,7 +18,7 @@ in
];
options.services.zigbee2mqtt = {
enable = mkEnableOption (lib.mdDoc "enable zigbee2mqtt service");
enable = mkEnableOption (lib.mdDoc "zigbee2mqtt service");
package = mkOption {
description = lib.mdDoc "Zigbee2mqtt package to use";

View file

@ -12,11 +12,7 @@ in {
options = {
services.fluentd = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Whether to enable fluentd.";
};
enable = mkEnableOption (lib.mdDoc "fluentd");
config = mkOption {
type = types.lines;

View file

@ -109,13 +109,7 @@ in
{
options = {
services.logcheck = {
enable = mkOption {
default = false;
type = types.bool;
description = lib.mdDoc ''
Enable the logcheck cron job.
'';
};
enable = mkEnableOption (lib.mdDoc "logcheck cron job");
user = mkOption {
default = "logcheck";

View file

@ -68,13 +68,8 @@ in
{
options = {
services.exhibitor = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to enable the exhibitor server.
'';
};
enable = mkEnableOption (lib.mdDoc "exhibitor server");
# See https://github.com/soabase/exhibitor/wiki/Running-Exhibitor for what these mean
# General options for any type of config
port = mkOption {

View file

@ -8,11 +8,7 @@ in
{
options.services.gollum = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Enable the Gollum service.";
};
enable = mkEnableOption (lib.mdDoc "Gollum service");
address = mkOption {
type = types.str;

View file

@ -24,11 +24,7 @@ let
in {
options.services.zookeeper = {
enable = mkOption {
description = lib.mdDoc "Whether to enable Zookeeper.";
default = false;
type = types.bool;
};
enable = mkEnableOption (lib.mdDoc "Zookeeper");
port = mkOption {
description = lib.mdDoc "Zookeeper Client port.";

View file

@ -7,13 +7,7 @@ let
in {
options = {
services.arbtt = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Enable the arbtt statistics capture service.
'';
};
enable = mkEnableOption (lib.mdDoc "Arbtt statistics capture service");
package = mkOption {
type = types.package;

View file

@ -22,13 +22,7 @@ in {
services.bosun = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to run bosun.
'';
};
enable = mkEnableOption (lib.mdDoc "bosun");
package = mkOption {
type = types.package;

View file

@ -8,11 +8,7 @@ let
in {
options = {
services.cadvisor = {
enable = mkOption {
default = false;
type = types.bool;
description = lib.mdDoc "Whether to enable cadvisor service.";
};
enable = mkEnableOption (lib.mdDoc "Cadvisor service");
listenAddress = mkOption {
default = "127.0.0.1";

View file

@ -49,13 +49,7 @@ let
};
in {
options.services.datadog-agent = {
enable = mkOption {
description = lib.mdDoc ''
Whether to enable the datadog-agent v7 monitoring service
'';
default = false;
type = types.bool;
};
enable = mkEnableOption (lib.mdDoc "Datadog-agent v7 monitoring service");
package = mkOption {
default = pkgs.datadog-agent;

View file

@ -6,11 +6,7 @@ let
cfg = config.services.heapster;
in {
options.services.heapster = {
enable = mkOption {
description = lib.mdDoc "Whether to enable heapster monitoring";
default = false;
type = types.bool;
};
enable = mkEnableOption (lib.mdDoc "Heapster monitoring");
source = mkOption {
description = lib.mdDoc "Heapster metric source";

View file

@ -1563,13 +1563,7 @@ in
options.services.prometheus = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Enable the Prometheus monitoring daemon.
'';
};
enable = mkEnableOption (lib.mdDoc "Prometheus monitoring daemon");
package = mkOption {
type = types.package;

View file

@ -27,13 +27,8 @@ in {
options = {
services.riemann = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Enable the Riemann network monitoring daemon.
'';
};
enable = mkEnableOption (lib.mdDoc "Riemann network monitoring daemon");
config = mkOption {
type = types.lines;
description = lib.mdDoc ''

View file

@ -9,7 +9,7 @@ in {
options = {
services.samba-wsdd = {
enable = mkEnableOption (lib.mdDoc ''
Enable 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.
::: {.note}

View file

@ -9,7 +9,7 @@ let
in
{
options.services.magic-wormhole-mailbox-server = {
enable = mkEnableOption (lib.mdDoc "Enable Magic Wormhole Mailbox Server");
enable = mkEnableOption (lib.mdDoc "Magic Wormhole Mailbox Server");
};
config = mkIf cfg.enable {

View file

@ -1,13 +1,8 @@
{ config, lib, pkgs, ... }:
{
options.services.mozillavpn.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = lib.mdDoc ''
Enable the Mozilla VPN daemon.
'';
};
options.services.mozillavpn.enable =
lib.mkEnableOption (lib.mdDoc "Mozilla VPN daemon");
config = lib.mkIf config.services.mozillavpn.enable {
environment.systemPackages = [ pkgs.mozillavpn ];

View file

@ -365,7 +365,7 @@ in {
If you enable this option the
`networkmanager_strongswan` plugin will be added to
the {option}`networking.networkmanager.plugins` option
so you don't need to to that yourself.
so you don't need to do that yourself.
'';
};

View file

@ -26,11 +26,7 @@ in {
### Interface
options.services.onedrive = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = lib.mdDoc "Enable OneDrive service";
};
enable = lib.mkEnableOption (lib.mdDoc "OneDrive service");
package = lib.mkOption {
type = lib.types.package;

View file

@ -10,7 +10,7 @@ in
###### interface
options = {
services.owamp.enable = mkEnableOption (lib.mdDoc "Enable OWAMP server");
services.owamp.enable = mkEnableOption (lib.mdDoc "OWAMP server");
};

View file

@ -23,11 +23,7 @@ in
services.polipo = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Whether to run the polipo caching web proxy.";
};
enable = mkEnableOption (lib.mdDoc "polipo caching web proxy");
proxyAddress = mkOption {
type = types.str;

View file

@ -49,11 +49,8 @@ in
{
options = {
services.smokeping = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Enable the smokeping service";
};
enable = mkEnableOption (lib.mdDoc "smokeping service");
alertConfig = mkOption {
type = types.lines;
default = ''

View file

@ -75,7 +75,7 @@ let
in {
options.services.peertube = {
enable = lib.mkEnableOption (lib.mdDoc "Enable Peertubes service");
enable = lib.mkEnableOption (lib.mdDoc "Peertube");
user = lib.mkOption {
type = lib.types.str;

View file

@ -28,13 +28,7 @@ let
cfg.settings));
in {
options.services.clight = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to enable clight or not.
'';
};
enable = mkEnableOption (lib.mdDoc "clight");
temperature = {
day = mkOption {