summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorqolii <qoli@protonmail.com>2018-10-20 13:44:13 -0700
committerMatthew Robbetts <qoli@protonmail.com>2018-10-20 13:52:43 -0700
commitee0444576ff01d40fe734137c298104cac8ca705 (patch)
treedff5bc35828c7215386e4e50ddfe6cfbb0e315d1 /nixos/modules/services/networking
parentaf1a28501701f56b7289e8e3d855e638272d2a3d (diff)
downloadnixlib-ee0444576ff01d40fe734137c298104cac8ca705.tar
nixlib-ee0444576ff01d40fe734137c298104cac8ca705.tar.gz
nixlib-ee0444576ff01d40fe734137c298104cac8ca705.tar.bz2
nixlib-ee0444576ff01d40fe734137c298104cac8ca705.tar.lz
nixlib-ee0444576ff01d40fe734137c298104cac8ca705.tar.xz
nixlib-ee0444576ff01d40fe734137c298104cac8ca705.tar.zst
nixlib-ee0444576ff01d40fe734137c298104cac8ca705.zip
Address review feedback.
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r--nixos/modules/services/networking/eternal-terminal.nix31
1 files changed, 12 insertions, 19 deletions
diff --git a/nixos/modules/services/networking/eternal-terminal.nix b/nixos/modules/services/networking/eternal-terminal.nix
index aa9d399a4a3a..1d2dc5d23b97 100644
--- a/nixos/modules/services/networking/eternal-terminal.nix
+++ b/nixos/modules/services/networking/eternal-terminal.nix
@@ -16,17 +16,11 @@ in
 
     services.eternal-terminal = {
 
-      enable = mkOption {
-        default = false;
-        type = types.bool;
-        description = ''
-          Enable the Eternal Terminal server.
-        '';
-      };
+      enable = mkEnableOption "Eternal Terminal server";
 
       port = mkOption {
-        default = null;
-        type = types.nullOr types.int;
+        default = 2022;
+        type = types.int;
         description = ''
           The port the server should listen on. Will use the server's default (2022) if not specified.
         '';
@@ -34,17 +28,17 @@ in
 
       verbosity = mkOption {
         default = 0;
-        type = types.int;
+        type = types.enum (lib.range 0 9);
         description = ''
           The verbosity level (0-9).
         '';
       };
 
-      silence = mkOption {
-        default = 0;
-        type = types.int;
+      silent = mkOption {
+        default = false;
+        type = types.bool;
         description = ''
-          Silence.
+          If enabled, disables all logging.
         '';
       };
 
@@ -78,13 +72,12 @@ in
             ; et.cfg : Config file for Eternal Terminal
             ;
 
-            ${optionalString (cfg.port != null) ''
-              [Networking]
-              port = ${toString cfg.port}
-            ''}
+            [Networking]
+            port = ${toString cfg.port}
+
             [Debug]
             verbose = ${toString cfg.verbosity}
-            silent = ${toString cfg.silence}
+            silent = ${if cfg.silent then "true" else "false"}
             logsize = ${toString cfg.logSize}
           ''}";
           Restart = "on-failure";