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 = {
|
options = {
|
||||||
hardware.brillo = {
|
hardware.brillo = {
|
||||||
enable = mkEnableOption (lib.mdDoc ''
|
enable = mkEnableOption (lib.mdDoc ''
|
||||||
Enable brillo in userspace.
|
brillo in userspace.
|
||||||
This will allow brightness control from users in the video group.
|
This will allow brightness control from users in the video group
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.udev.packages = [ pkgs.brillo ];
|
services.udev.packages = [ pkgs.brillo ];
|
||||||
environment.systemPackages = [ pkgs.brillo ];
|
environment.systemPackages = [ pkgs.brillo ];
|
||||||
|
|
|
@ -10,7 +10,7 @@ let
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.hardware.ubertooth = {
|
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 {
|
group = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.hardware.wooting.enable =
|
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 {
|
config = mkIf config.hardware.wooting.enable {
|
||||||
environment.systemPackages = [ pkgs.wootility ];
|
environment.systemPackages = [ pkgs.wootility ];
|
||||||
|
|
|
@ -4,7 +4,7 @@ let
|
||||||
cfg = config.programs.kclock;
|
cfg = config.programs.kclock;
|
||||||
kclockPkg = pkgs.libsForQt5.kclock;
|
kclockPkg = pkgs.libsForQt5.kclock;
|
||||||
in {
|
in {
|
||||||
options.programs.kclock = { enable = mkEnableOption (lib.mdDoc "Enable KClock"); };
|
options.programs.kclock = { enable = mkEnableOption (lib.mdDoc "KClock"); };
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.dbus.packages = [ kclockPkg ];
|
services.dbus.packages = [ kclockPkg ];
|
||||||
|
|
|
@ -12,7 +12,7 @@ in
|
||||||
{
|
{
|
||||||
###### interface
|
###### interface
|
||||||
options.services.kubernetes.flannel = {
|
options.services.kubernetes.flannel = {
|
||||||
enable = mkEnableOption (lib.mdDoc "enable flannel networking");
|
enable = mkEnableOption (lib.mdDoc "flannel networking");
|
||||||
};
|
};
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
|
@ -18,7 +18,7 @@ in
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
options.services.foldingathome = {
|
options.services.foldingathome = {
|
||||||
enable = mkEnableOption (lib.mdDoc "Enable the Folding@home client");
|
enable = mkEnableOption (lib.mdDoc "Folding@home client");
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -34,13 +34,7 @@ in {
|
||||||
|
|
||||||
services.couchdb = {
|
services.couchdb = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "CouchDB Server");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to run CouchDB Server.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -15,13 +15,7 @@ in {
|
||||||
|
|
||||||
services.opentsdb = {
|
services.opentsdb = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "OpenTSDB");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to run OpenTSDB.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -18,7 +18,7 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
options.services.zigbee2mqtt = {
|
options.services.zigbee2mqtt = {
|
||||||
enable = mkEnableOption (lib.mdDoc "enable zigbee2mqtt service");
|
enable = mkEnableOption (lib.mdDoc "zigbee2mqtt service");
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = lib.mdDoc "Zigbee2mqtt package to use";
|
description = lib.mdDoc "Zigbee2mqtt package to use";
|
||||||
|
|
|
@ -12,11 +12,7 @@ in {
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
services.fluentd = {
|
services.fluentd = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "fluentd");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc "Whether to enable fluentd.";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
|
|
@ -109,13 +109,7 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.logcheck = {
|
services.logcheck = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "logcheck cron job");
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Enable the logcheck cron job.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
default = "logcheck";
|
default = "logcheck";
|
||||||
|
|
|
@ -68,13 +68,8 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.exhibitor = {
|
services.exhibitor = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "exhibitor server");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to enable the exhibitor server.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
# See https://github.com/soabase/exhibitor/wiki/Running-Exhibitor for what these mean
|
# See https://github.com/soabase/exhibitor/wiki/Running-Exhibitor for what these mean
|
||||||
# General options for any type of config
|
# General options for any type of config
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
|
|
|
@ -8,11 +8,7 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.services.gollum = {
|
options.services.gollum = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Gollum service");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc "Enable the Gollum service.";
|
|
||||||
};
|
|
||||||
|
|
||||||
address = mkOption {
|
address = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
|
@ -24,11 +24,7 @@ let
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.services.zookeeper = {
|
options.services.zookeeper = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Zookeeper");
|
||||||
description = lib.mdDoc "Whether to enable Zookeeper.";
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
description = lib.mdDoc "Zookeeper Client port.";
|
description = lib.mdDoc "Zookeeper Client port.";
|
||||||
|
|
|
@ -7,13 +7,7 @@ let
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
services.arbtt = {
|
services.arbtt = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Arbtt statistics capture service");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Enable the arbtt statistics capture service.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -22,13 +22,7 @@ in {
|
||||||
|
|
||||||
services.bosun = {
|
services.bosun = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "bosun");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to run bosun.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -8,11 +8,7 @@ let
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
services.cadvisor = {
|
services.cadvisor = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Cadvisor service");
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = lib.mdDoc "Whether to enable cadvisor service.";
|
|
||||||
};
|
|
||||||
|
|
||||||
listenAddress = mkOption {
|
listenAddress = mkOption {
|
||||||
default = "127.0.0.1";
|
default = "127.0.0.1";
|
||||||
|
|
|
@ -49,13 +49,7 @@ let
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.services.datadog-agent = {
|
options.services.datadog-agent = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Datadog-agent v7 monitoring service");
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to enable the datadog-agent v7 monitoring service
|
|
||||||
'';
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
default = pkgs.datadog-agent;
|
default = pkgs.datadog-agent;
|
||||||
|
|
|
@ -6,11 +6,7 @@ let
|
||||||
cfg = config.services.heapster;
|
cfg = config.services.heapster;
|
||||||
in {
|
in {
|
||||||
options.services.heapster = {
|
options.services.heapster = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Heapster monitoring");
|
||||||
description = lib.mdDoc "Whether to enable heapster monitoring";
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
source = mkOption {
|
source = mkOption {
|
||||||
description = lib.mdDoc "Heapster metric source";
|
description = lib.mdDoc "Heapster metric source";
|
||||||
|
|
|
@ -1563,13 +1563,7 @@ in
|
||||||
|
|
||||||
options.services.prometheus = {
|
options.services.prometheus = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Prometheus monitoring daemon");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Enable the Prometheus monitoring daemon.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
|
|
|
@ -27,13 +27,8 @@ in {
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
services.riemann = {
|
services.riemann = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "Riemann network monitoring daemon");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Enable the Riemann network monitoring daemon.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
|
|
|
@ -9,7 +9,7 @@ in {
|
||||||
options = {
|
options = {
|
||||||
services.samba-wsdd = {
|
services.samba-wsdd = {
|
||||||
enable = mkEnableOption (lib.mdDoc ''
|
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.
|
to be found by Web Service Discovery Clients like Windows.
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
|
|
|
@ -9,7 +9,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.magic-wormhole-mailbox-server = {
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
options.services.mozillavpn.enable = lib.mkOption {
|
options.services.mozillavpn.enable =
|
||||||
type = lib.types.bool;
|
lib.mkEnableOption (lib.mdDoc "Mozilla VPN daemon");
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Enable the Mozilla VPN daemon.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.services.mozillavpn.enable {
|
config = lib.mkIf config.services.mozillavpn.enable {
|
||||||
environment.systemPackages = [ pkgs.mozillavpn ];
|
environment.systemPackages = [ pkgs.mozillavpn ];
|
||||||
|
|
|
@ -365,7 +365,7 @@ in {
|
||||||
If you enable this option the
|
If you enable this option the
|
||||||
`networkmanager_strongswan` plugin will be added to
|
`networkmanager_strongswan` plugin will be added to
|
||||||
the {option}`networking.networkmanager.plugins` option
|
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
|
### Interface
|
||||||
|
|
||||||
options.services.onedrive = {
|
options.services.onedrive = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkEnableOption (lib.mdDoc "OneDrive service");
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc "Enable OneDrive service";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
|
|
|
@ -10,7 +10,7 @@ in
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options = {
|
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 = {
|
services.polipo = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "polipo caching web proxy");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc "Whether to run the polipo caching web proxy.";
|
|
||||||
};
|
|
||||||
|
|
||||||
proxyAddress = mkOption {
|
proxyAddress = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
|
@ -49,11 +49,8 @@ in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.smokeping = {
|
services.smokeping = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "smokeping service");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc "Enable the smokeping service";
|
|
||||||
};
|
|
||||||
alertConfig = mkOption {
|
alertConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = ''
|
default = ''
|
||||||
|
|
|
@ -75,7 +75,7 @@ let
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.services.peertube = {
|
options.services.peertube = {
|
||||||
enable = lib.mkEnableOption (lib.mdDoc "Enable Peertube’s service");
|
enable = lib.mkEnableOption (lib.mdDoc "Peertube");
|
||||||
|
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
|
|
@ -28,13 +28,7 @@ let
|
||||||
cfg.settings));
|
cfg.settings));
|
||||||
in {
|
in {
|
||||||
options.services.clight = {
|
options.services.clight = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption (lib.mdDoc "clight");
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Whether to enable clight or not.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
temperature = {
|
temperature = {
|
||||||
day = mkOption {
|
day = mkOption {
|
||||||
|
|
Loading…
Reference in a new issue