treewide: use mkEnableOption
in nixos modules
This commit is contained in:
parent
095269c862
commit
b4674b39c1
31 changed files with 36 additions and 131 deletions
|
@ -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 ];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -12,7 +12,7 @@ in
|
|||
{
|
||||
###### interface
|
||||
options.services.kubernetes.flannel = {
|
||||
enable = mkEnableOption (lib.mdDoc "enable flannel networking");
|
||||
enable = mkEnableOption (lib.mdDoc "flannel networking");
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 ''
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -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.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -10,7 +10,7 @@ in
|
|||
###### interface
|
||||
|
||||
options = {
|
||||
services.owamp.enable = mkEnableOption (lib.mdDoc "Enable OWAMP server");
|
||||
services.owamp.enable = mkEnableOption (lib.mdDoc "OWAMP server");
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
|
@ -75,7 +75,7 @@ let
|
|||
|
||||
in {
|
||||
options.services.peertube = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Enable Peertube’s service");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Peertube");
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue