From 0345c30b1b3c3b01ba5455a7fc6bee338c36052a Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 13 Jul 2015 17:36:31 +0200 Subject: 3 tv.*: use mkEnableOption --- 3modules/tv/consul.nix | 8 ++------ 3modules/tv/ejabberd.nix | 5 +---- 3modules/tv/git.nix | 7 ++----- 3modules/tv/identity.nix | 8 ++------ 3modules/tv/iptables.nix | 5 +---- 3modules/tv/nginx.nix | 6 +----- 3modules/tv/retiolum.nix | 6 +----- 3modules/tv/urlwatch.nix | 12 ++---------- 8 files changed, 12 insertions(+), 45 deletions(-) (limited to '3modules') diff --git a/3modules/tv/consul.nix b/3modules/tv/consul.nix index dc9a180dd..480198456 100644 --- a/3modules/tv/consul.nix +++ b/3modules/tv/consul.nix @@ -21,12 +21,8 @@ let }; api = { - # TODO inherit (lib) api.options.enable; oder so - enable = mkOption { - type = types.bool; - default = false; - description = "enable tv.consul"; - }; + enable = mkEnableOption "tv.consul"; + dc = mkOption { type = types.unspecified; }; diff --git a/3modules/tv/ejabberd.nix b/3modules/tv/ejabberd.nix index ffcc5cfb4..e75c995af 100644 --- a/3modules/tv/ejabberd.nix +++ b/3modules/tv/ejabberd.nix @@ -11,10 +11,7 @@ let }; api = { - enable = mkOption { - type = types.bool; - default = false; - }; + enable = mkEnableOption "tv.ejabberd"; certFile = mkOption { type = types.str; diff --git a/3modules/tv/git.nix b/3modules/tv/git.nix index 5adfe7472..e19063fa8 100644 --- a/3modules/tv/git.nix +++ b/3modules/tv/git.nix @@ -23,11 +23,8 @@ let }; api = { - enable = mkOption { - type = types.bool; - default = false; - description = "Enable Git repository hosting."; - }; + enable = mkEnableOption "tv.git"; + cgit = mkOption { type = types.bool; default = true; diff --git a/3modules/tv/identity.nix b/3modules/tv/identity.nix index 7cf90de01..c3c2f17bf 100644 --- a/3modules/tv/identity.nix +++ b/3modules/tv/identity.nix @@ -1,9 +1,7 @@ { lib, ... }: with lib; - let - cfg = config.tv.identity; out = { @@ -12,10 +10,8 @@ let }; api = { - enable = mkOption { - type = types.bool; - default = false; - }; + enable = mkEnableOption "tv.identity"; + self = mkOption { type = types.unspecified; }; diff --git a/3modules/tv/iptables.nix b/3modules/tv/iptables.nix index 096b04e1d..7b9edd38b 100644 --- a/3modules/tv/iptables.nix +++ b/3modules/tv/iptables.nix @@ -11,10 +11,7 @@ let }; api = { - enable = mkOption { - type = types.bool; - default = false; - }; + enable = mkEnableOption "tv.iptables"; input-internet-accept-new-tcp = mkOption { type = with types; listOf str; diff --git a/3modules/tv/nginx.nix b/3modules/tv/nginx.nix index d9d95be84..93cd88aac 100644 --- a/3modules/tv/nginx.nix +++ b/3modules/tv/nginx.nix @@ -11,11 +11,7 @@ let }; api = { - enable = mkOption { - type = types.bool; - default = false; - description = "Enable nginx."; - }; + enable = mkEnableOption "tv.nginx"; retiolum-locations = mkOption { type = with types; listOf (attrsOf str); diff --git a/3modules/tv/retiolum.nix b/3modules/tv/retiolum.nix index 7c78d7124..8dc4197aa 100644 --- a/3modules/tv/retiolum.nix +++ b/3modules/tv/retiolum.nix @@ -11,11 +11,7 @@ let }; api = { - enable = mkOption { - type = types.bool; - default = false; - description = "Enable tinc daemon for Retiolum."; - }; + enable = mkEnableOption "tv.retiolum"; name = mkOption { type = types.str; diff --git a/3modules/tv/urlwatch.nix b/3modules/tv/urlwatch.nix index d6e796ca7..aed247852 100644 --- a/3modules/tv/urlwatch.nix +++ b/3modules/tv/urlwatch.nix @@ -7,11 +7,12 @@ with builtins; with lib; - let cfg = config.tv.urlwatch; api = { + enable = mkEnableOption "tv.urlwatch"; + dataDir = mkOption { type = types.str; default = "/var/lib/urlwatch"; @@ -19,15 +20,6 @@ let Directory where the urlwatch service should store its state. ''; }; - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable the urlwatch service. - If enabled, then create a timer that calls urlwatch and sends mails - whenever something has changed or an error occurs. - ''; - }; from = mkOption { type = types.str; default = "${cfg.user}@${config.networking.hostName}.retiolum"; -- cgit v1.2.3 [cgit] Unable to lock slot /tmp/cgit/e2100000.lock: No such file or directory (2)